Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want sendig email with please help me?
andy(-RKO) 19-Mar-12 3:09am    
try this :


Basically, you put the data you need in the Web form and use HTTP request method "post". On server side, you gather the requested data, make a e-mail message our of it and send it using some mail agent (most typically, using SMTP).

First of all, please see:[^][^].

See also:
Please see:[^],[^].

This topic is too popular. With CodeProject along, you can find plenty of relevant information and code samples:
unable to send mail , it showing the error in below code .[^].

I need to warn you about security in your approach. This is really serious. Please see my past answer:
unable to send mail , it showing the error in below code .[^].

Share this answer
try this,

MailAddress mailfrom = new MailAddress ( "" );
MailAddress mailto = new MailAddress ( "" );
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 ( "", 587 );
smtps.UseDefaultCredentials = false;
smtps.Credentials = new NetworkCredential ( "", "urpwd" );
smtps.EnableSsl = true;
smtps.Send ( newmsg );
Share this answer
Have a look :

string configMailID = "";
string ContactMailID = "";
 string subject ="Hello";
string mailBody = "HI";
int mailSent = SendMailThroughOutlook(configMailID,ContactMailID,subject,mailBody);

public int SendMailThroughOutlook(string mailFrom,string mailTO,string mailSubject,string mailBody)
            int isMailSent = 0;
            MailMessage message = new MailMessage();           
                message.From = new MailAddress(mailFrom);
                string[] AdminIds = mailTO.Split(',');
                for (int i = 0; i < AdminIds.Length; i++)
                    message.To.Add(new MailAddress(AdminIds[i]));
                if (mailCC.Trim().Length != 0)

                message.Subject = mailSubject;
                message.Body = mailBody;
                message.IsBodyHtml = true;
                SmtpClient client = new SmtpClient("", 25);
                client.DeliveryMethod = SmtpDeliveryMethod.Network;
                Exception ex = new Exception();
                isMailSent = 1;
            catch (Exception ex)
                isMailSent = 0;
            return isMailSent;
Share this answer
Share this answer
Please refer following url,

Send mail using Google Apps[^]

Hope this may help you...
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