On Mar 22, 3:51 pm, "Aidy" <a...@noemail.xxxa.comwrote:
You need to specify how the mail is to be delivered. If you are using an
external SMTP server you need to specify, or if you are using IIS' SMTP
server you need to specify that too.
Google these for more info;
http://schemas.microsoft.com/cdo/con...tion/sendusing
http://schemas.microsoft.com/cdo/con...ickupdirectory
"Santosh" <Santoshmshinde...@yahoo.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
Dear all, i am wrtiing following code for the sending email from the
my asp application when i am working on the local machine i will work
fine ans send email on the mentioned address. but when i deploy it on
the server it doen not work. and also does not give any error.
MailMessage newMessage = new MailMessage();
newMessage.From =txtEmail.Text.Trim();
newMessage.To="santosh.shi...@vritti.co.in";
newMessage.Subject="Comments-Suggestion";
newMessage.Priority=System.Web.Mail.MailPriority.N ormal;
string msgBody = txtSuggestion.Text.Trim() ;
SmtpMail.Send(newMessage);
newMessage.Body = msgBody;
please tell me what is the problem with in it.
Regards,
Santosh Shinde.- Hide quoted text -
- Show quoted text -
i am trying following code
MailMessage newMessage = new MailMessage();
newMessage.From =txtEmail.Text.Trim();
//newMessage.To ="in**@goloka.com.au";
newMessage.To="sa************@vritti.co.in";
newMessage.Subject="Comments-Suggestion";
newMessage.Priority=System.Web.Mail.MailPriority.N ormal;
string msgBody = txtSuggestion.Text.Trim() ;
newMessage.Body = msgBody;
SmtpMail.SmtpServer="gmail.com";
//SmtpMail.SmtpServer="127.0.0.1";
// Smtp configuration
//SmtpMail.SmtpServer = "smtp.yahoo.com";
// - smtp.gmail.com use smtp authentication
newMessage .Fields.Add("http://schemas.microsoft.com/cdo/
configuration/smtpauthenticate", "1");
newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
configuration/sendusername", "my*****@gmail.com");
newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
configuration/sendpassword", "mypassword");
// // - smtp.gmail.com use port 465 or 587
newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
configuration/smtpserverport", "465");
// // - smtp.gmail.com use STARTTLS (some call this SSL)
newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
configuration/smtpusessl", "true");
// try to send Mail
//newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
configuration/smtpusessl", "true");
SmtpMail.Send(newMessage);
but it gives an error
Please tell me what is the problem. can there is any other way