0

Hi all,how r u?
i am trying to send email from my priject, i write the following code

Dim myMail As New MailMessage()
myMail.From = "from@microsoft.com"
myMail.To = "to@microsoft.com"
myMail.Subject = "UtilMailMessage001"
myMail.Priority = MailPriority.Low
myMail.BodyFormat = MailFormat.Html
myMail.Body = "<html><body>UtilMailMessage001 - success</body></html>"
' Dim myAttachment As New MailAttachment("c:\attach1.txt", MailEncoding.Base64)
' myMail.Attachments.Add(myAttachment)
SmtpMail.SmtpServer = "MyMailServer"
SmtpMail.Send(myMail)

but in run time its not working and tells me
"the transport faild to connect to the server"
can any one tell me what to do??


thanks

4
Contributors
4
Replies
5
Views
11 Years
Discussion Span
Last Post by ManicCW
0

Have you got the server name correct? (btw I've not tested that so I'm not saying the above code is necessarily correct)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.