Click here to Skip to main content
Rate this: bad
good
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 22:28pm
V Mohan486
Comments
Anele Ngqandu at 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 Blush | :O
  Permalink  
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 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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 363
1 OriginalGriff 344
2 George Jonsson 248
3 Shemeemsha RA 138
4 Animesh Datta 130
0 OriginalGriff 6,179
1 Sergey Alexandrovich Kryukov 5,616
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 3 Dec 2012
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