Sending Email With an Attachment
-
Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.
-
Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.
-
Hi, Who can I send email with an attachment? This is the code witchh I use but it don't work. Something missing? Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() oMsg.From = "noone@nobody.com" oMsg.To = "someone@somewhere.com" oMsg.Subject = "Email with Attachment Demo" oMsg.Body = "This is the main body of the email" Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") oMsg.Attachments.Add(oAttch) SmtpMail.Send(oMsg) Please help me! Thanx anyway.
You didn't set the smtp sever property. What error are you getting? "People who never make mistakes, never do anything." My Blog