无法通过SMTP服务器发送电子邮件 [英] Unable to send email through SMTP Server

查看:618
本文介绍了无法通过SMTP服务器发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi, I am using following code to send email through smtp server, I have tested this code on my machine and its working fine but after deploying the project on server 2003, exe file runs okay but i am not receiving any emails?







Any ideas?

'create the mail message 

Dim mail As New MailMessage() 

Dim smtp As New SmtpClient("smtp.server.europe.com") 

Dim Str As String = "" 'Create Body Str = "BODY TXT" 



mail.From = New MailAddress("smtp.serevr address") 

mail.To.Add(multiple email addresses here)

 'set the content 

mail.Subject = _Sub mail.Attachments.Add(NewSystem.Net.Mail.Attachment(Attachment_File)) 

mail.Body = Str 

Try 

'send mail smtp.Send(mail) 

Catch ex As SmtpException 

Throw ex.InnerException 

Finally 

mail.Dispose() 

End Try

推荐答案

这不是Outlook代码.也许是System.NetMail?我认为,无论如何,VB.NET论坛都是问这个问题的合适地方.
This isn't Outlook code. Maybe it's System.NetMail? In any case, a VB.NET forum would be the right place to ask about it, I think. 


这篇关于无法通过SMTP服务器发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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