I also trying to send Email from my app

Discussion in 'ASP.NET / ASP.NET Core' started by jazzcatone, May 30, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello and thanks for taking a second to read this message. I am trying to get my application to send an email out. When I Hit my submit button I get the following error:The "SendUsing" configuration value is invalid.
    Below is my code to send the email out. It has a problem with the SmtpMail.Send( objMailMessage )line that has the emoticons next to it.On myI use Web Matrix locally and it works fine. Any help would be greatly appreciated. Thanks- Jason


    --------------------------------------------------------------------------------------------------



    If IsValid Then


    'Create the Mail Message


    Dim objMailMessage As MailMessage


    objMailMessage = New MailMessage()


    objMailMessage.Priority= MailPriority.High


    objMailMessage.From = "[email protected]"


    objMailMessage.To = txtEmail.Text


    objMailMessage.Subject = "Hello " & txtusername.text & ","& vbCrLf


    objMailMessage.Body= "Thank you for entering your information.Your information is as follows:"& vbcrlf & _


    "Name:"& txtusername.text & vbcrlf & _


    "Address:"& txtAddress.text & vbcrlf & _


    "City:" & txtCity.text & vbcrlf & _


    "State:" & dropstate.SelectedItem.Text & vbcrlf & _


    "Zip:" & txtZipCode.Text & vbcrlf & _


    "Phone:" & txtPhone.Text & vbcrlf & _


    "Phone 2:" & txtPhone2.Text & vbcrlf & _


    "Work Phone:" & txtPhone3.Text & vbcrlf & _


    "Email:" & txtEmail.Text & vbcrlf & _


    "All information will be kept as private and as secure as possible." & vbcrlf & _


    "Best Regards," & vbcrlf & _


    "Jason Livengood"





    ' Send the Mail Message


    SmtpMail.Send( objMailMessage )[​IMG][​IMG]


    Response.Redirect( "ThankYou.aspx" )


    End If
     
  2. [​IMG]It seems like you forgot to declare your mail server before attempting to send mail message.


    Try declaring SMTP Server="LocalHost" in your code[​IMG]

    J. L.
    Technical Support/IT Admin/MIS Developer
    Maxtop Enterprises Inc.
    http://www.maxtop.ca</CODE>
     
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