|
-
January 9th, 2009, 06:55 AM
#1
send email vb.net
Hi Expert,
I have a program that send email...but It would not send a mail in a sender sent item..code is below
SmtpMail.SmtpServer = txtSMTPServer.Text
'Multiple recepients can be specified using ; as the delimeter
Mailmsg.To = txtTo.Text
Mailmsg.From = "\" & txtFromDisplayName.Text & "\ <" & txtFrom.Text & ">"
'Specify the body format
If chkFormat.Checked = True Then
Mailmsg.BodyFormat = MailFormat.Html 'Send the mail in HTML Format
Else
Mailmsg.BodyFormat = MailFormat.Text
End If
'If you want you can add a reply to header
'Mailmsg.Headers.Add("Reply-To", "[email protected]")
'custom headersare added like this
'Mailmsg.Headers.Add("Manoj", "TestHeader")
Mailmsg.Subject = txtSubject.Text
For Counter = 0 To lstAttachment.Items.Count - 1
Attachment = New MailAttachment(lstAttachment.Items(Counter))
Mailmsg.Attachments.Add(Attachment)
Next
Mailmsg.Body = txtMessage.Text
SmtpMail.Send(Mailmsg)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|