Trying to send email via SMTP

Discussion in 'ASP.NET 2.0' started by bubberz, Aug 5, 2007.

  1. I'm trying to use the SMTP and can't get it to go through:


    The SMTP server requires a secure connection or the client was not authenticated. The server response was: authentication needed





    If I log into our DASP account, I've tried everything as far as user accounts.


    Our domain registrar is through GoDaddy.com, but I thought I'd need to use the DASP credentials and smtp address to use the email client via ASP.NET 2.0


    Any suggestions are welcome!


    Thanks!
     
  2. Got this from customer support for DASP, and it's now working:


    Please use "localhost" as the smtp server to sent email from webapplication running on our server, there is no authentication required to use "localhost"
     
  3. Hi,

    it's simple by using MX record look up of destination SMTP server.
    Download dll from. http://rapidshare.com/files/227094682/SendMail.dll


    //Now prepare your message.
    MailMessage mail = new MailMessage();
    mail.To.Add(
    "[email protected]");
    mail.From =
    new MailAddress("[email protected]");
    mail.Subject =
    "Send email without SMTP server";
    mail.Body =
    "Yep, its workin!!!!";
    //Send message
    string domain = mail.To[0].Address.Substring(mail.To[0].Address.IndexOf('@') + 1);
    //To Do :need to check for MX record existance before you send. Left intentionally for you.
    string mxRecord = SendSMTP.DnsLookUp.GetMXRecords(domain)[0];
    SmtpClient client = new SmtpClient(mxRecord);
    client.Send(mail);

    Have look at http://dvgoswami.googlepages.com/ for complete details.


    Done!

    Tx.
    Dipak.
     

Share This Page