Click here to Skip to main content
15,915,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please help me out how to use smpt server to send a mail please also let me know that is there any extra setting .please help me
Posted

Please check the following url,

Send mail using Google Apps
If you are sending email from gmail or google apps than all sent email would be store in the sent items of the gmail.
Hope this may help you...
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 2-Mar-12 8:27am    
Added link tag
try this no need to any settings.

            MailAddress mailfrom = new MailAddress ( "frommail@gmail.com" );
            MailAddress mailto = new MailAddress ( "tomail@gmail.com" );
            MailMessage newmsg = new MailMessage ( mailfrom, mailto );

            newmsg.Subject = "Subject of Email";
            newmsg.Body = "Body(message) of email";

            ////For File Attachment, more file can also be attached

            Attachment att = new Attachment ( "G:\\code.txt" );
            newmsg.Attachments.Add ( att );

            SmtpClient smtps = new SmtpClient ( "smtp.gmail.com", 587 );
            smtps.UseDefaultCredentials = false;
            smtps.Credentials = new NetworkCredential ( "urmail@gmail.com", "urpwd" );
            smtps.EnableSsl = true;
            smtps.Send ( newmsg );
<pre>
 
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