Email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JMMB

    #1

    Email

    what would be the best technology to send emails in a ASP.NET Application?
    I used to use CDONTS with ASP.

    thanks,


  • Frank Drebin

    #2
    Re: Email

    Well, here is the lazy answer (this is what I ended up doing). Include
    CDONTS (the COM object) in your references.. and use it like this:

    CDONTS.NewMailC lass objMail = new CDONTS.NewMailC lass();
    string SendFrom = Request.Form["From"] + " <" + Request.Form["FromEmail"] +
    ">";
    string SendTo ="Frank Drebin <someemail@some email.com>";
    string From = Request.Form["From"];
    string FromEmail = Request.Form["FromEmail"];
    string Subject = Request.Form["Subject"];
    string Msg = Request.Form["Msg"].Replace("\n"," <br>"); // Replace carriage
    returns with line breaks
    string BodyText = "";
    BodyText += "<STYLE> .MsgTxt { font-family:Verdana, Arial; font-size: 10pt;
    font-style: normal; line-height: normal;font-weight: normal} </STYLE>";
    BodyText += "<ul>";
    BodyText += "<table width=\"100%\"> \n";
    BodyText += "<tr><td class=MsgTxt>Fr om:</td><td class=MsgTxt><b >" + From + "
    (<a href=mailto:" + FromEmail + ">" + FromEmail + "</a>)</b></td>\n";
    BodyText += "<tr><td class=MsgTxt>Se nt:</td><td class=MsgTxt><b >" +
    DateTime.Now.To String() + "</b></td>\n";
    BodyText += "<tr><td class=MsgTxt>Su bject:</td><td class=MsgTxt><b >" +
    Subject + "</b></td>\n";
    BodyText += "</table><hr>\n";
    BodyText += Msg + '\n';
    BodyText += "-----\n";
    BodyText += "</ul>";
    objMail.BodyFor mat = 0;
    objMail.MailFor mat = 0;
    objMail.Send(Se ndFrom,SendTo, Subject, BodyText, 1);


    "JMMB" <mbarbieri@bf.c om.br> wrote in message
    news:%23IlgIFpZ DHA.1580@tk2msf tngp13.phx.gbl. ..[color=blue]
    > what would be the best technology to send emails in a ASP.NET Application?
    > I used to use CDONTS with ASP.
    >
    > thanks,
    >
    >[/color]


    Comment

    Working...