使用c#发送电子邮件而不使用CDONTS [英] send email using c# without using CDONTS
本文介绍了使用c#发送电子邮件而不使用CDONTS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的先生们
i希望用c#
发送电子邮件,但我不想使用CDONTS
或告诉我怎么能使用它
i不知道关于CDONTS的任何事情
谢谢
解决方案
< blockquote>大约1-2天前看到其他帖子....
-
William Stacey,MVP
>
" Mohammed Abdel-Razzak" <一个******* @ discussions.microsoft.com>写在
消息新闻:fe **************************** @ phx.gbl ... < blockquote class =post_quotes>亲爱的先生们
我想用c#
发送电子邮件,但我不想使用CDONTS
或告诉我如何使用它
我不知道关于CDONTS的任何事情
谢谢
旧主题的主要消息不可用。
我使用了这个例行程序。工作正常。尺寸有限制。取决于操作系统。
使用System;
使用System.Drawing;
使用System.Windows.Forms;
使用System.Diagnostics;
命名空间TeleM
{
公共类电子邮件:表格
{
私人字符串e_address;
私人字符串主题;
私人字符串主体;
public Email(字符串e_address,字符串主题,字符串正文)
{
this.e_address = e_address;
this.subject = subject;
this.body = body;
do_mail();
}
private void do_mail()
{
try
{
string message = string.Format(" mailto: {0}?subject = {1}& body = {2}",
e_address,subject,body);
Process.Start(message); < br $>
}
catch
{
MessageBox.Show(" Message is too
big。"," Error",MessageBoxButtons.OK,MessageBoxIcon。War ning);
}
}
}
}
William Stacey [MVP]" < ST *********** @ mvps.org>在留言中写道
新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...参见其他大约1-2天前就发布了这个消息....
- William Stacey,MVP
Mohammed Abdel-Razzak <一个******* @ discussions.microsoft.com>在
消息新闻中写道:fe **************************** @ phx.gbl ...亲爱的先生们
我想用c#
发送电子邮件,但我不想使用CDONTS
或告诉我如何使用它
我不知道关于CDONTS的任何事情
感谢
> string message = string.Format(" mailto:{0}?subject = {1}& body = {2}",
Internet Explorer mailto协议有一些严重的问题缺点。网址
大小不能超过2kb。所以这一般没用。
我建议搜索通过SMTP发送邮件的实现。
它快速可靠。
问候,
Wiktor Zychla
dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS
thanks
解决方案
see other post on this about 1-2 days ago....
--
William Stacey, MVP
"Mohammed Abdel-Razzak" <an*******@discussions.microsoft.com> wrote in
message news:fe****************************@phx.gbl...dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS
thanks
The old messages re the subject are unavailable.
I used this routine. Works ok. There is a limit on size. Depends on OS.
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Diagnostics;
namespace TeleM
{
public class Email:Form
{
private string e_address;
private string subject;
private string body;
public Email(string e_address, string subject, string body)
{
this.e_address=e_address;
this.subject=subject;
this.body=body;
do_mail();
}
private void do_mail()
{
try
{
string message = string.Format( "mailto:{0}?subject={1}&body={2}",
e_address, subject, body );
Process.Start( message );
}
catch
{
MessageBox.Show("Message is too
big.","Error",MessageBoxButtons.OK,MessageBoxIcon. Warning);
}
}
}
}
"William Stacey [MVP]" <st***********@mvps.org> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...see other post on this about 1-2 days ago....
--
William Stacey, MVP
"Mohammed Abdel-Razzak" <an*******@discussions.microsoft.com> wrote in
message news:fe****************************@phx.gbl...dear sirs
i want to send email using c#
but i don`t want to use CDONTS
or tell me how can i use it
i don`t know any thing about CDONTS
thanks
> string message = string.Format( "mailto:{0}?subject={1}&body={2}",
the Internet Explorer mailto protocol has some serious drawback. the URL
size cannot exceed 2kb. so this is useless in general.
what I suggest is to search for the implementation of sending mail via SMTP.
it''s fast and reliable.
Regards,
Wiktor Zychla
这篇关于使用c#发送电子邮件而不使用CDONTS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文