Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0
Hi friends
actually i found smtp address by typing ping smtp.server.com.in command prompt. that adddress is 216.69.186.201. and my code for sending email is
MailMessage Msg = new MailMessage();
                // Sender e-mail address.
                Msg.From = txtFrom.Text;
                // Recipient e-mail address.
                Msg.To = txtTo.Text;
                Msg.Subject = txtSubject.Text;
                Msg.Body = txtBody.Text;
                // your remote SMTP server IP.
                SmtpMail.SmtpServer = "216.69.186.201";
                SmtpMail.Send(Msg);
                Msg = null;
                Page.RegisterStartupScript("UserMsg", "<script>alert('Mail sent thank you...');if(alert){ window.location='SendMail.aspx';}</script>");
 
and the error is
The message could not be sent to the SMTP server. The transport error code was 0x800ccc6f. The server response was 554 Your access to this mail system has been rejected due to the sending MTA's poor reputation. If you believe that this failure is in error, please contact the intended recipient via alternate means.
Posted 20-Mar-13 4:14am
Edited 20-Mar-13 4:16am
v2
Comments
joshrduncan2012 at 20-Mar-13 9:20am
   
What is your question?
Sergey Alexandrovich Kryukov at 20-Mar-13 9:33am
   
I think I know. Please see my comment below :-)
—SA
Sergey Alexandrovich Kryukov at 20-Mar-13 9:33am
   
Do you want us to improve MTA's reputation? :-)
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi,
try this
 
MailAddress mailfrom = new MailAddress("fromaddress");
            MailAddress mailto = new MailAddress("toaddress");
            MailMessage newmsg = new MailMessage(mailfrom, mailto);
 
            newmsg.Subject = "subjtect";
            //txtMsg.Text = @"";
            newmsg.Body = "Body message";
 
            //For File Attachment, more file can also be attached
            //Attachment att = new Attachment(@"C:\Users\admin\Desktop\");
            //newmsg.Attachments.Add(att);
            SmtpClient smtps = new SmtpClient("smtp.gmail.com", 587);
            smtps.UseDefaultCredentials = true;
            smtps.Credentials = new NetworkCredential("from address","password");
            smtps.EnableSsl = true;
            smtps.Send(newmsg);
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 341
1 Marcin Kozub 225
2 Sergey Alexandrovich Kryukov 220
3 Praneet Nadkar 197
4 Shweta N Mishra 161
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100