• (3 Pages)
  • +
  • 1
  • 2
  • 3

Sending e-mail messages using C# How to send e-mail messages using C# and WinForms.

#31 sumanthkumarch  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 7
  • Joined: 08-February 12

Posted 08 February 2012 - 08:12 PM

i kindly request you to tell all the sample parameters to be entered in the application for gmail or ymail or any mail server to send a email

This post has been edited by modi123_1: 08 February 2012 - 10:38 PM
Reason for edit:: removed excessive quote

Was This Post Helpful? 0
  • +
  • -

#32 sumanthkumarch  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 7
  • Joined: 08-February 12

Posted 08 February 2012 - 08:18 PM

i have used sendserver:smtp.gmail.com serverport:2525 from:mymail id to:frenmail id uname:my mail id pasword: mailid password


I am getting an error mail sending failed.Please help me this code is very useful in my project.
Was This Post Helpful? 0
  • +
  • -

#33 shendism  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 3
  • Joined: 09-February 12

Posted 09 February 2012 - 05:57 PM

View Postsumanthkumarch, on 08 February 2012 - 08:18 PM, said:

i have used sendserver:smtp.gmail.com serverport:2525 from:mymail id to:frenmail id uname:my mail id pasword: mailid password


I am getting an error mail sending failed.Please help me this code is very useful in my project.


Try smtpserverport:587 i write some code maybe will help you... i'm not understanding what exactly are you looking for
Hope i help you

MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); 
mail.From = new MailAddress("email@gmail.com");
mail.To.Add("email@smth.smth");       
mail.Subject = "Name of subject"
mail.Body = "mail with attachment";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("email@gmail.com", "paswword");


Was This Post Helpful? 0
  • +
  • -

#34 Joerabbit  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-March 12

Posted 19 March 2012 - 05:06 AM

View Postsumanthkumarch, on 08 February 2012 - 08:18 PM, said:

i have used sendserver:smtp.gmail.com serverport:2525 from:mymail id to:frenmail id uname:my mail id pasword: mailid password


I am getting an error mail sending failed.Please help me this code is very useful in my project.


Like Guest_Ed mentioned

sendserver = smtp.gmail.com // sets the server you're sending from to gmail
serverPort = 587 // the port used for gmail

and then you must set Enablessl to true, to activate SecureSocketlayer(SSL)

i.e. if you just want to send to from gmail server you can use:

client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;

or just type in:
client.EnableSsl = true; // in your button1, before you send the msg via client.Send(message);
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3