Click here to Skip to main content
11,707,470 members (73,647 online)
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 3:14am
Edited 20-Mar-13 3: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 Mika Wendelius 220
1 Maciej Los 195
2 OriginalGriff 148
3 Sergey Alexandrovich Kryukov 145
4 chainerlt 110
0 OriginalGriff 9,198
1 Sergey Alexandrovich Kryukov 8,562
2 CPallini 5,189
3 Maciej Los 4,921
4 Mika Wendelius 3,856


Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2015
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