Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Blat or MailMessage()
Message
From
30/08/2011 14:00:53
 
 
To
30/08/2011 13:16:09
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01522297
Message ID:
01522301
Views:
46
I'm a rank web newbie and I was able to get a contact page to send emails to site owner is less than an hour using SMTPMailer.

Here's the code
   SMTPMailer smtpMailer = new SMTPMailer();
     public string SMTPServer = ConfigurationSettings.AppSettings["SMTPServer"];
     public string SMTPUser = ConfigurationSettings.AppSettings["SMTPUser"];
     public string SMTPNotifyAddress = ConfigurationSettings.AppSettings["SMTPNotifyAddress"];
     public string SMTPPassword = ConfigurationSettings.AppSettings["SMTPPassword"];
    protected void ButtonSend_Click(object sender, EventArgs e)
    {
      string mailbody = "Email from :" + TextBoxFirstName.Text.TrimEnd() + " " + TextBoxLastName.Text.TrimEnd() + Environment.NewLine;

      mailbody += "Company: " + TextBoxCompany.Text.TrimEnd() + Environment.NewLine;
      mailbody += "State: " + DropDownListStates.SelectedValue + Environment.NewLine;  
      LabelMailStatus.Text  =  smtpMailer.SendMailMessasge(SMTPNotifyAddress,  TextBoxEmail.Text.TrimEnd(), "Test Send Subject", SMTPServer,
      SMTPUser,SMTPPassword,"", mailbody);   
    
    }
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform