Board index » Visual Studio » vb.net send email problem
|
NitaS
|
vb.net send email problem
Visual Studio112
Dear all, I try to send email through coding....which is successful (can receive the mail) ...however,,,when i add a attachment...even no error...but not receive any mail....don't know what's the problem.... the following is my testing code Dim email As New System.Web.Mail.MailMessage Dim sSubstr As String = "C:\k1.jpg" Dim myAttachment As MailAttachment = New MailAttachment(sSubstr) email.Attachments.Add(myAttachment) email.To = "test@test.com" email.From = "testtest@test.com" email.Body = sendbodytext email.Subject = "Test Test" email.BodyFormat = Web.Mail.MailFormat.Text System.Web.Mail.SmtpMail.SmtpServer = "<<my smtp ip>>" System.Web.Mail.SmtpMail.Send(email) Thanks - |
