Click here to Skip to main content
12,633,985 members (22,694 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
Hi

I am using SMTP client for sending mails, while sending mail it shows error as follows ;

Failure sending mail

Please someone help to resolve this problem

Thanks
Mohan
Posted 2-Dec-12 23:28pm
V Mohan522
Comments
Anele Ngqandu 3-Dec-12 4:30am
   
where is your code boss?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

Hi dear,

using System.Net.Mail;

private void MailSend()
        {
            try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");  
                SmtpServer.Host = "smtp.gmail.com";

                mail.From = new MailAddress("FromMailName@gamil.com");
                mail.To.Add("ToMailName@gmail.com");
                mail.Subject = "Test Mail";
                mail.Body = "This is for testing SMTP mail from GMAIL";

                SmtpServer.Port = 587;

                SmtpServer.Credentials = new System.Net.NetworkCredential("ToMailName@gmail.com", "123456"); // User Mail Name And Mail Password
                SmtpServer.EnableSsl = true;

                SmtpServer.Send(mail);              
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }


If you like this solution plz vote.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Similar thread is here : Failure Sending Mail[^]... This could help you :0
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi Mohan...

I was also facing the same problem, for solving the problem I called my mail server provider, they told they did not support SMTP server.

So my suggestion is, you will have to confirm with your service provider
whether they are provide SMTP service or not.

Best of luck

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

Solution 5

u need a smtp mail server ...
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

Hi,

There are some issues in sending mail by Using SMTP Credential ,
1. First Check is there any antivirus is running on system.if its running on system disable it.
2. Check your SMTP Credential.
3.Check Port is OPEN or NOT (25/587).

Best Luck...
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 22 Sep 2014
Copyright © CodeProject, 1999-2016
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