Results 1 to 2 of 2

Thread: Send E-Mail

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario, Canada
    Posts
    275

    Send E-Mail

    Hey,

    How can I send e-mail from a ASP.NET (vb.net) form ?

    Thanks !

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Need to make a reference to System.Web.Mail namespace first.

    VB Code:
    1. Dim theEmail As MailMessage = New MailMessage()
    2. theEmail.To = "[email protected]"
    3. theEmail.From = "[email protected]"
    4. theEmail.Subject = "My email subject"
    5. theEmail.Body = "The body of the email"
    6.  
    7. 'Set the smtp server to use.  Check with your hosting company.
    8. SmtpMail.SmtpServer = "mail.webhost4life.com"
    9.  
    10. 'Send the email.
    11. SmtpMail.Send(theEmail)

    Trap any errors while sending, so it can recover.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width