Windows

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Sending email with SMTP authentication

    0 answers - 962 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    use Using in first line when you cerate mail object
    rest of the thing is fine
    like
    using ( MailMessage Message = new MailMessage())
    {
    }
    Markus Hardiyanto <markus (AT) revti (DOT) comwrote:
    Hello,
    can some one help me on how to send email using SMTP
    authentication?
    i already tried the code below and get "could not
    access CDMessage object"
    using System;
    using System.Web.Mail;
    using System.Windows.Forms;
    MailMessage Message = new MailMessage();
    // SMTP Authentication
    Message.Fields.Add("","1");
    Message.Fields.Add("","user");
    Message.Fields.Add("","pass");
    Message.To = strTo;
    Message.From = strFrom;
    Message.Subject = strSubject;
    Message.Body = strBody;
    try
    {
    SmtpMail.SmtpServer = strMailServer;
    SmtpMail.Send(Message);
    }
    catch(System.Web.HttpException ehttp)
    {MessageBox.Show(ehttp.Message.ToString());
    }

Re: Sending email with SMTP authentication


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "Windows"

EMSDN.COM