Email sending problem from asp.net application

S

Santosh

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="(e-mail address removed)";
newMessage.Subject="Comments-Suggestion";
newMessage.Priority=System.Web.Mail.MailPriority.Normal;
string msgBody = txtSuggestion.Text.Trim() ;
SmtpMail.Send(newMessage);
newMessage.Body = msgBody;


please tell me what is the problem with in it.


Regards,
Santosh Shinde.
 
M

Mark Rae

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="(e-mail address removed)";
newMessage.Subject="Comments-Suggestion";
newMessage.Priority=System.Web.Mail.MailPriority.Normal;
string msgBody = txtSuggestion.Text.Trim() ;
SmtpMail.Send(newMessage);
newMessage.Body = msgBody;


please tell me what is the problem with in it.

How does it know where to find your SMTP queue...?
http://www.systemnetmail.com/faq/3.1.1.aspx
 
S

Santosh

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/configuration/sendusing

http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory









- Show quoted text -

i am trying following code

MailMessage newMessage = new MailMessage();
newMessage.From =txtEmail.Text.Trim();
//newMessage.To ="(e-mail address removed)";
newMessage.To="(e-mail address removed)";
newMessage.Subject="Comments-Suggestion";
newMessage.Priority=System.Web.Mail.MailPriority.Normal;
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", "(e-mail address removed)");
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
 
M

Mark Rae

but it gives an error

I've never understood why people post on a technical newsgroup that they are
getting an error, but then not actually say what the error is...!!!
Please tell me what is the problem. can there is any other way

Please tell the newsgroup what the error is...
 
S

Santosh

I've never understood why people post on a technical newsgroup that they are
getting an error, but then not actually say what the error is...!!!


Please tell the newsgroup what the error is...

Sorry forget to mention the error the error is :

The transport failed to connect to the server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,740
Latest member
AdolphBig6

Latest Threads

Top