Sending emails through Asp.net

Discussion in 'ASP .Net' started by mark, Nov 21, 2003.

  1. mark

    mark Guest

    I need to send order confirmation emails through my asp.net
    storefront. With my Asp 3.0 sites I use cdonts with no issues. I've
    researched the system.web.mail asp.net way and haven't got it to work.
    It boils down to the online smtp server declaration. I say a
    solution to active relay on the mail server but in the next sentence
    it said doing this may open your server up to spam relays. Not what I
    want to do. I've tried using cdonts with asp.net and actually was
    surprised to see it work offline while I was testing on my machine.
    When I tried it online I got an exception. Any thoughts on this? I
    even tried to use server.transfer("old asp3.0 email script") to
    trigger the email but also received an exception.
     
    mark, Nov 21, 2003
    #1
    1. Advertising

  2. mark

    Thomas R Guest

    Mark,

    Although I'm no expert on this subject I don't see how using the built in
    System.Web.Mail class could ever "open up for relaying spam". The mail class
    and your SMTP server has absolutely nothing to do with eachother other than
    an occasional handshake whenever you are trying to send a mail.

    MailMessage m = new MailMessage();
    m.Subject = "Hello world";
    m.From= "";
    m.To = "";
    m.Body = "This is just a test";
    SmtpMail.SmtpServer = "localhost"; //or whatever SMTP server that normally
    allows you to relay (could be your ISPs)
    SmtpMail.Send(m);

    What happens here is simply that the Send method of SmtpMail class connects
    to the specified SMTP server and sends the mail!

    This is a transcript of what's going on when sending a mail:

    >HELO localhost //Function handshakes with SMTP-server
    >250 locahost Hello localhost // Server responds
    >mail from: //function sends sender email
    >250 Sender OK //Server accepts
    >rcpt to: //function sends recipients email
    >250 Recipient OK. Will forward //Server accepts (OR denies!!)
    >data //Starting actual body and subject
    >subject: "Hello world"
    >
    >This is just a test
    >. //the dot tells the smtp server that message is completed
    >250 Message accepted for delivery //Server accepts and sends!


    I don't see any reasons why all of a sudden your SMTP server should be open
    for spammers. This can only be changed by a setting inside your Mailserver,
    and not by .Net itself unless you are able to code directly to your mail
    server!

    If anyone else has another (or better) explanation, please disregard this
    one! ;)

    Hope that it helps,

    Thomas Regin.


    "mark" <> wrote in message
    news:...
    > I need to send order confirmation emails through my asp.net
    > storefront. With my Asp 3.0 sites I use cdonts with no issues. I've
    > researched the system.web.mail asp.net way and haven't got it to work.
    > It boils down to the online smtp server declaration. I say a
    > solution to active relay on the mail server but in the next sentence
    > it said doing this may open your server up to spam relays. Not what I
    > want to do. I've tried using cdonts with asp.net and actually was
    > surprised to see it work offline while I was testing on my machine.
    > When I tried it online I got an exception. Any thoughts on this? I
    > even tried to use server.transfer("old asp3.0 email script") to
    > trigger the email but also received an exception.
     
    Thomas R, Nov 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Santry

    Re: Re: Sending emails through Asp.net

    Patrick Santry, Nov 21, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    725
    Thomas R
    Nov 21, 2003
  2. Steve Thurston

    Problem sending emails through AOL connection

    Steve Thurston, Jan 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    724
    Steve Thurston
    Jan 19, 2004
  3. TomS
    Replies:
    0
    Views:
    384
  4. Ryan
    Replies:
    0
    Views:
    394
  5. =?Utf-8?B?QnJpYW4gTQ==?=

    ASP.NET not sending SMTP emails on Windows 2003

    =?Utf-8?B?QnJpYW4gTQ==?=, Nov 16, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    4,614
    =?Utf-8?B?QnJpYW4gTQ==?=
    Nov 16, 2004
Loading...

Share This Page