Send Email

ilyail3

Active member
Joined
Feb 15, 2005
Messages
31
Programming Experience
1-3
How can I send email through vb?
Post some code example please
 
hi ,

find the following code if useful to you ,


VB.NET:
 Dim Mailmsg As New System.Web.Mail.MailMessage
 
        'Multiple recepients can be specified using ; as the delimeter
        'Address of the recipient
        Mailmsg.To = "[email="someone@some.com"]someone@some.com[/email]"
        'Your From Address
        'You can also use a custom header Reply-To for a different replyto address
        Mailmsg.From = "[email="someone@some.com"]someone@some.com[/email]"

        'Specify the body format
        
            Mailmsg.BodyFormat = MailFormat.Html 'Send the mail in HTML Format
        
          ' or 
       '  Mailmsg.BodyFormat = MailFormat.Text
       
        'Mail Subject
        Mailmsg.Subject = "Subject "
        Dim counter As Integer
        
        'Mail Body
        Mailmsg.Body = "Mail Body"
        'Call the send method to send the mail
        Try
            SmtpMail.SmtpServer = "Server"
            SmtpMail.Send(Mailmsg)
             
        Catch ex As Exception
           
        End Try
 
[Code]
 
Thanks ,
           Jay
 
Back
Top