Sending email from a form

Discussion in 'ASP.NET / ASP.NET Core' started by marlatim, Jan 11, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I am trying to send email from a .net page. Here is the essential code for instatiating the mailmessage object and assigning it properties.
    MailMessage mailmessage = new MailMessage();

    mailmessage.To = "mailto:[email protected]";
    mailmessage.From = txtName.Text;
    mailmessage.Subject = "New entry in the Guest book";
    mailmessage.BodyFormat = MailFormat.Text;
    mailmessage.Body = tboxcomments.Text; ;

    SmtpMail.Send(mailmessage);

    When I submit the form I get the following error message
    The "SendUsing" configuration value is invalid.
    with the line SmtpMail.Send(mailmessage); highlighted. Anybody know what this error means? Do I need to configure something in order to send email?
    Thanks,</font id="Arial">
    Tim
     
  2. Yep,

    You need to set the value for the smtp server, which is "localhost".

     
  3. Thanks!
     
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