Click here to Skip to main content
15,888,224 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want send email from my project (asp 4)
with local host
please help me
i write below code:



C#
SmtpClient smtpClient = new SmtpClient();
           smtpClient.UseDefaultCredentials = false;
           smtpClient.Host = "smtp.yahoo.com";
           smtpClient.Port = 587;
           smtpClient.Credentials = new NetworkCredential("xxxxx@yahoo.com", "myPassword");
           smtpClient.EnableSsl = true;
           MailMessage mailmsg = new MailMessage("xxxxx@yahoo.com",        "xxxxx@yahoo.com", "subject", "body");
           mailmsg.Priority = MailPriority.High;
           smtpClient.Send(mailmsg);


why are not true my project?
Posted
Updated 7-Mar-12 5:13am
v3
Comments
Dave Kreskowiak 7-Mar-12 11:04am    
Uhh....What? "why are not true my project" doesn't make sense at all.

You're using Yahoo's SMTP to send an email. So what's the problem? If it's not working, try changing the port number to 995 or 465.
ZurdoDev 7-Mar-12 11:13am    
What is the problem? Are you trying to send email through yahoo or through localhost?
[no name] 7-Mar-12 11:14am    
Format code snippets and don't include your email
Herman<T>.Instance 7-Mar-12 11:24am    
from: http://techblissonline.com/yahoo-pop3-and-smtp-settings/

Yahoo POP3 and SMTP Settings:
Find below the basic POP3 settings for configuring any email program where you want to receive Yahoo mails.

■“POP3 Server” – Set the POP server for incoming mails as pop.mail.yahoo.com. You will have to enable “SSL” and use 995 for Port.
■“SMTP Server” – Set the SMTP server for outgoing mails as smtp.mail.yahoo.com. You will also have to make sure that “SSL” is enabled and use 465 for port. you must also enable “authentication” for this to work.
■“Account Name or Login Name” – Your Yahoo Mail ID i.e. your email address without the domain “@yahoo.com”.
■“Email Address” – Your Yahoo Mail address i.e. your email address including the domain “@yahoo.com”. E.g. myname@yahoo.com
■“Password” – Your Yahoo Mail password.

1 solution

read this[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900