Sending e-mail messages using C# How to send e-mail messages using C# and WinForms.
#16 Guest_turqoil*
Posted 28 April 2010 - 05:58 PM
#17 Guest_Ed*
Posted 06 January 2011 - 06:37 AM
SmtpClient client = new SmtpClient("smtp.live.com"); MailMessage message = new MailMessage("[email protected]", "[email protected]"); message.Body = "Some text"; message.Subject = "A subject"; client.Credentials = new System.Net.NetworkCredential(Username, Password); /*---->*/ client.Port = 587; /*---->*/ client.EnableSsl = true; client.Send(message);
Note the two key lines: port number is set to 587 and enablessl is set because hotmail uses SecureSocketsLayer on its connections. The email that is sent says :
From: [the server email account adress] on behalf of [name of person account is registered to] ([the email address you put as from i.e. [email protected]])
This means you cannot create fake emails through Hotmail without the receiver knowing

Hope this helps, Ed
This post has been edited by JackOfAllTrades: 07 January 2011 - 06:40 AM
#18
Posted 18 March 2011 - 07:14 AM
How I can solve it?
Thanks for help.
#19
Posted 18 March 2011 - 07:37 AM
#20
#21
Posted 01 April 2011 - 03:35 AM
when I am sending mail at that time error occur
Cannot sent Message : Failure sending mail.
can you tell me what is the problem in my code.
try { MailMessage mail = new MailMessage(txtfrom.Text, txtto.Text); mail.From = new MailAddress(txtfrom.Text); mail.To.Add(txtto.Text); mail.Subject = txtsubject.Text; mail.Body = txtmess.Text; SmtpClient smtp = new SmtpClient(); smtp.Host = "mail.mycompanyid.net"; smtp.Port = 25; NetworkCredential NetCrd = new NetworkCredential(); NetCrd.Domain = "ip"; NetCrd.UserName = "myid"; NetCrd.Password = "mypass"; smtp.UseDefaultCredentials = false; smtp.Credentials = NetCrd; smtp.EnableSsl = true; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Send(mail); MessageBox.Show("Your Message Sent Successfully"); } catch (Exception ee) { MessageBox.Show("Cannot send message: " + ee.Message); }
#22
Posted 02 June 2011 - 12:20 AM
*******REMOVED EMAIL ADDRESS******* thanks please please
The parameter 'from' cannot be an empty string.
Parameter name: from
MailMessage message = new MailMessage(sendFrom.Text, sendTo.Text);
#23
Posted 07 June 2011 - 01:05 PM
minhkhanh62, on 02 June 2011 - 03:20 AM, said:
*******REMOVED EMAIL ADDRESS******* thanks please please
The parameter 'from' cannot be an empty string.
Parameter name: from
MailMessage message = new MailMessage(sendFrom.Text, sendTo.Text);
I think that error message is pretty self-explanatory. The From parameter(the first parameter) can't be blank.
#25
Posted 23 June 2011 - 07:20 PM
When sending email, it actually send from the email I set.
Is it possible to not displaying my email but display "[email protected]" to receiver?
#26
Posted 23 June 2011 - 07:38 PM
l.jessie1268, on 23 June 2011 - 07:20 PM, said:
When sending email, it actually send from the email I set.
Is it possible to not displaying my email but display "[email protected]" to receiver?
lol. i'm create successed

#27
Posted 25 June 2011 - 05:54 AM
minhkhanh62, on 23 June 2011 - 07:38 PM, said:
l.jessie1268, on 23 June 2011 - 07:20 PM, said:
When sending email, it actually send from the email I set.
Is it possible to not displaying my email but display "[email protected]" to receiver?
lol. i'm create successed

Please advise. Thanks

#28
Posted 25 June 2011 - 06:20 AM
l.jessie1268, on 25 June 2011 - 05:54 AM, said:
minhkhanh62, on 23 June 2011 - 07:38 PM, said:
l.jessie1268, on 23 June 2011 - 07:20 PM, said:
When sending email, it actually send from the email I set.
Is it possible to not displaying my email but display "[email protected]" to receiver?
lol. i'm create successed

Please advise. Thanks

i haven't upload yet ! pm me. yahoo messenger ! satthudaudoimu62 or [email protected] i'll send my source hiii thanks everybody. send gmail and attach file.
#29
Posted 29 October 2011 - 03:45 AM
what to write in send server,server port?how can i find that from my computer?
what to write in send from? user and password?which user id ??
#30
Posted 06 January 2012 - 06:13 AM