re: simple webform that links to email

Discussion in 'ASP.NET / ASP.NET Core' started by ccabanero, Jul 4, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    I would like to create an asp webform that is linked to my email account. This would be a simple "contact us" form. After the user types in their first name, last name, email, and comments, they click a button and the message is sent to my email.

    Does anyone have any sample code, articles, web references, etc. that they can point me to?

    Thanks,

    Clint
     
  2. I did this to send mail

    1. add this line :
    Imports System.Web.Mail.SmtpMail

    2. setup and send the mail

    Dim myEmail As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
    '---- Set Message Properties -------------
    myEmail.From = "[email protected]"
    myEmail.To = "[email protected]"
    myEmail.Subject = "MySubject"
    myEmail.BodyFormat = System.Web.Mail.MailFormat.Html
    myEmail.Body = "MailBody"

    '---- Send Message -------------------------
    System.Web.Mail.SmtpMail.SmtpServer = "localhost"
    System.Web.Mail.SmtpMail.Send(myEmail)
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page