-1

Please help me I am using this script..

Found the full code Here

 public void sendemail(int MemberId, DataTable Member, int rowNo)
    {
        MailMessage msgMail = new MailMessage();

        msgMail.To = Member.Rows[rowNo]["EmailID"].ToString();
        msgMail.From = "admin@auditionbollywood.com"; 
        msgMail.Subject = "Auditions BollyWood Account Expire";
        msgMail.BodyFormat = MailFormat.Text;
        StringBuilder sb = new StringBuilder();
        sb.AppendFormat("Hi !\n\n");
        sb.AppendFormat("Your Audition Bollywood Account has been expired.Please pay the payment for activation.\n");
        sb.AppendFormat("Click the below link to pay to activate your account\n");
        string link = string.Format("http://www.auditionbollywood.com/paymentrenewal.aspx?MemberId={0}", MemberId.ToString());
        sb.Append(link);
        sb.AppendFormat("\n\nThank You");
        msgMail.Body = sb.ToString();
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "mail.auditionbollywood.com");
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 587);
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2);
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "admin@auditionbollywood.com");
        msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "**********");
        SmtpMail.SmtpServer = "mail.auditionbollywood.com";
        SmtpMail.Send(msgMail);
    }
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
Kushal Gupta
  • 25
  • 1
  • 5

2 Answers2

0

The symbolic name for error code 0x80040217 is CDO_E_LOGON_FAILURE which has the following description:

The transport was unable to log on to the server.

You need to provide valid credentials to send using that SMTP server.

Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
  • its not working, i've tried the same conf to setup an outlook, – Kushal Gupta Jul 03 '15 at 09:45
  • @KushalGupta: Looking at your source code on pastebin I do not see any attempt to authenticate against the SMTP server. – Martin Liversage Jul 03 '15 at 10:25
  • I called that function on line 110 – Kushal Gupta Jul 03 '15 at 10:36
  • @KushalGupta: I overlooked that you actually authenticate in your code. The `SmtpMail` class was obsoleted long time ago and replaced by the `SmtpClient` class which I suggest that you use. But no matter how you send the mail you currently is told by the server that you fail to authenticate so you have to fix that. It could be a wrong password or something else. – Martin Liversage Jul 03 '15 at 10:57
0

The error means that the SMTP server rejected your e-mail.Reasons:

  1. information is incorrect

  2. SMTP server does not allow you to send e-mails externally.Check with SMTP administrator.

3.change email login security not to use the 2-step verification, but only a password.