SmtpMail.Send()没有错误但没有电子邮件。 [英] SmtpMail.Send() No Error but no Email either.

查看:203
本文介绍了SmtpMail.Send()没有错误但没有电子邮件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我使用下面给出的标准代码从ASP.NET

网络表单发送电子邮件。代码执行正常但没有发送电子邮件。所有电子邮件都会在Inetpub邮件队列中排队等待。


我正在使用我的本地默认SMTP服务器而我的地址是有效的

Yahoo / Hotmail地址。我已将本地SMTP服务器配置为允许

IP地址127.0.0.1。


这可能是因为雅虎/ hotmail服务器需要身份验证吗?


这是我使用的代码。


private void SendSimpleMail()

{


MailMessage objEmail = New MailMessage();

objEmail.From =" va ****** @ yahoo.com" ;;

objEmail .To =" an ************** @ hotmail.com" ;;

objEmail.Subject =" Test Mail";

objEmail.Body =" Test Mail - Body";

SmtpMail.SmtpServer =" 127.0.0.1";

SmtpMail.Send(objEmail);


}

任何想法从ASP.NET发送简单的

电子邮件可能有什么问题或我需要做些什么?任何帮助都会被贬低。


问候,

supz

解决方案

" SUPZ" <苏**** @ yahoo.com>在消息中写道

news:11 ********************* @ t39g2000cwt.googlegro ups.com ...
< blockquote class =post_quotes>这可能是因为雅虎/ hotmail服务器需要身份验证吗?



www.systemwebmail.com


您可能需要在iis下以smtp设置智能主机设置。

这告诉IIS如何路由SMTP消息,实际上将谁传递给

以便继续发送。


-

问候


John Timney

Microsoft MVP


" supz" <苏**** @ yahoo.com>在消息中写道

news:11 ********************* @ t39g2000cwt.googlegro ups.com ...



我使用下面给出的标准代码从ASP.NET
Web表单发送电子邮件。代码执行正常但没有发送电子邮件。所有电子邮件都在Inetpub邮件队列中排队。

我正在使用我的本地默认SMTP服务器,而我的地址是有效的Yahoo / Hotmail地址。我已配置本地SMTP服务器以允许IP地址127.0.0.1。

这可能是因为雅虎/ hotmail服务器需要身份验证吗?

这里''我使用的代码。

private void SendSimpleMail()


MailMessage objEmail = New MailMessage();
objEmail.From =" va******@yahoo.com" ;;
objEmail.To =" an ************** @ hotmail.com" ;;
objEmail。 Subject =" Test Mail";
objEmail.Body =" Test Mail - Body";
SmtpMail.SmtpServer =" 127.0.0.1";

SmtpMail。发送(objEmail);

}

任何想法,从ASP.NET发送一封简单的电子邮件,或者我需要做些什么?任何帮助都会被贬低。

问候,
supz



感谢您的及时回复。这可能是一个愚蠢的问题,但

我真的需要设置智能主机设置吗?我读到某处

本地SMTP服务器将邮件发送到中继服务器,

会将邮件发送给收件人。如果我使用雅虎发送地址

在from中现场,雅虎服务器是否负责提供邮件?


Hi,

I use the standard code given below to send an email from an ASP.NET
web form. The code executes fine but no Email is sent. All emails get
queued in the Inetpub mail queue.

I''m using my local default SMTP Server and my from address is a valid
Yahoo/Hotmail address. I have configures the local SMTP Server to allow
the IP Address 127.0.0.1.

Could this be because yahoo/hotmail servers need authentication?

Here''s the code I use.

private void SendSimpleMail()
{

MailMessage objEmail = New MailMessage();
objEmail.From = "va******@yahoo.com";
objEmail.To = "an**************@hotmail.com";
objEmail.Subject = "Test Mail";
objEmail.Body = "Test Mail - Body";
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(objEmail);

}
Any idea what could be wrong or what I need to do to send a simple
email from ASP.NET? Any help would be appreaciated.

Regards,
supz

解决方案

"supz" <su****@yahoo.com> wrote in message
news:11*********************@t39g2000cwt.googlegro ups.com...

Could this be because yahoo/hotmail servers need authentication?



www.systemwebmail.com


You may have forgotton to set up your smart host settings in smtp under iis.
This tells IIS how to route the SMTP message, in effect who to pass it to
for onward delivery.

--
Regards

John Timney
Microsoft MVP

"supz" <su****@yahoo.com> wrote in message
news:11*********************@t39g2000cwt.googlegro ups.com...

Hi,

I use the standard code given below to send an email from an ASP.NET
web form. The code executes fine but no Email is sent. All emails get
queued in the Inetpub mail queue.

I''m using my local default SMTP Server and my from address is a valid
Yahoo/Hotmail address. I have configures the local SMTP Server to allow
the IP Address 127.0.0.1.

Could this be because yahoo/hotmail servers need authentication?

Here''s the code I use.

private void SendSimpleMail()
{

MailMessage objEmail = New MailMessage();
objEmail.From = "va******@yahoo.com";
objEmail.To = "an**************@hotmail.com";
objEmail.Subject = "Test Mail";
objEmail.Body = "Test Mail - Body";
SmtpMail.SmtpServer = "127.0.0.1";
SmtpMail.Send(objEmail);

}
Any idea what could be wrong or what I need to do to send a simple
email from ASP.NET? Any help would be appreaciated.

Regards,
supz



Thanks for your prompt replies. This might be a stupid quuestion, but
do I really need to set up the smart host settings? I read somewhere
that the local SMTP server sends the mail to the relay server which
will send the email to the recipient. If I send using a "yahoo" address
in the "from" field, is it the responsibilty of the Yahoo server to
deliver the mail?


这篇关于SmtpMail.Send()没有错误但没有电子邮件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆