使用SMTP发送邮件。 [英] Send mail with SMTP.
本文介绍了使用SMTP发送邮件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨!!!
我的SMTP服务器有问题。
我有一个SMTP服务器,当我发送邮件时,会自动获取gmail帐号发送。
我不知道会发生什么。我认为是因为设置了SMTP。
怎么能把它搞砸呢???我在代码中调试:
smtpclient.send(mailmessage)来自电子邮件是正确的但当我在邮箱中检查时它是不对的。
请帮帮我!!!
解决方案
您好,
这是您使用的唯一代码?
SMTP客户端对象默认使用服务器设置。
我认为服务器或应用程序中设置了Gmail帐户设置。
请尝试以下代码:
Dim SmtpObj As 新 System.Net.Mail.SmtpClien
SmtpObj.Host = smtp.mailserver.com
SmtpObj.Credentials = 新 System.Net.NetworkCredential( user, 密码)
SmtpObj.EnableSsl = True
SmtpObj.Port = 587
SmtpObj.Send(mail)
问候,
Andi
Hi !!!
I have a problem with SMTP server.
I have a SMTP server, when i send mail, it will auto get gmail account to send.
I dont know what happens. I think because of setting of SMTP.
How can it debbug it ??? I have debug in code :
smtpclient.send(mailmessage) From email is correct but when i check in mail box it is not right.
Please help me !!!
解决方案
Hi,
this is the only code you use?
The SMTP client objects uses the server settings by default.
I think there is the Gmail-Account set in the server or application settings.
Try the following code:
Dim SmtpObj As New System.Net.Mail.SmtpClien SmtpObj.Host = "smtp.mailserver.com" SmtpObj.Credentials = New System.Net.NetworkCredential("user", "password") SmtpObj.EnableSsl = True SmtpObj.Port = 587 SmtpObj.Send(mail)
Regards,
Andi
这篇关于使用SMTP发送邮件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文