Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Blat or MailMessage()
Message
De
02/09/2011 10:02:14
 
 
À
30/08/2011 14:00:53
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01522297
Message ID:
01522576
Vues:
34
Bill,

I'm finally getting a chance to look at your code.

I've tried the SMTPMailer declaration but get the error:

The type or namespace name 'SMTPMailer' could not be found (are you missing a using directive or an assembly reference?)

What assembly does this come from? I would normally get an option to fill in the Using line, but this is not available so I'm guessing the .NET version I am using is different to you?


>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);   
>    
>    }
>
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform