I am writing a code for an email
every thing is perfect but i am getting error like method name expected can u pls help me in this
MailMessage Email = new MailMessage()
{
Subject = "email from",
body = txtMessage.Text,
from = new MailAddress(txtEmail.Text, txtName.Text)
};
Email.To.Add(new MailAddress("[email protected]","prashanthi"));
SmtpClient server = new SmtpClient();
server.Send(Email);
Sam HobbsPosted Oct 9, 2010, 9:09 PM
I don't understand the brackets ("{" and "}"). That indicates to me that there is code that is relevant to the problem that you are not showing.
I don't know what "Subject", "body" and "from" are.
Most imprtantly, I don't know what line of your code is getting the error.
Suthish NairPosted Oct 9, 2010, 3:21 PM
you can also use gmail for sending mails.. refer article:
http://www.c-sharpcorner.com/UploadFile/prathore/2464/Default.aspx