Z
Zagor
I have a feedback form in my website with three TextBoxes and a SEND button
in a user control.
Below is a piece of the code:
//On click event for the send LinkButton
private void SendClicked(object sender, EventArgs e){
try{
if (Page.IsValid){
SendMail();
Response.Redirect("notify.aspx?Notifyass");}
}
catch(Exception ex){..................whatever}
//Actual code for sending the EMail
private void SendMail()
{
MailMessage objEmail = new MailMessage();
objEmail.From = this.tbEMail.Text;
objEmail.Priority = System.Web.Mail.MailPriority.High;
objEmail.To = TO_ADDRESS;//whatever
objEmail.Subject = SUBJECT_TEXT ;//whatever
objEmail.Body = "\nName :" + this.tbFullName.Text + "\nEMail: " +
this.tbEMail.Text +"\n\nMessage:"+this.tbMessage.Text;
objEmail.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer = SMTP_SERVER; //whatever is the smtp
SmtpMail.Send( objEmail );
objEmail = null;
}
if I use it with my ISP on my IIS everything is fine I can send the form
without any problem. When I upload it to my host service (obviously
modifying accordingly the SMTP) I
Server Error in '/' Application.
--------------------------------------------------------------------------------
The transport failed to connect to the server.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The
transport failed to connect to the server.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80040213): The transport failed to connect to the server.
etc.etc.
The Hosting Service claims that is my code , but I cannot find anything
wrong with it.( considering that works with my IIS).but I don't like to say
that they are wrong until I am positive that I am not.
Can anybody help me please and give me more information on how to solve this
problem?
thank you in advance for your help
in a user control.
Below is a piece of the code:
//On click event for the send LinkButton
private void SendClicked(object sender, EventArgs e){
try{
if (Page.IsValid){
SendMail();
Response.Redirect("notify.aspx?Notifyass");}
}
catch(Exception ex){..................whatever}
//Actual code for sending the EMail
private void SendMail()
{
MailMessage objEmail = new MailMessage();
objEmail.From = this.tbEMail.Text;
objEmail.Priority = System.Web.Mail.MailPriority.High;
objEmail.To = TO_ADDRESS;//whatever
objEmail.Subject = SUBJECT_TEXT ;//whatever
objEmail.Body = "\nName :" + this.tbFullName.Text + "\nEMail: " +
this.tbEMail.Text +"\n\nMessage:"+this.tbMessage.Text;
objEmail.BodyFormat = MailFormat.Text;
SmtpMail.SmtpServer = SMTP_SERVER; //whatever is the smtp
SmtpMail.Send( objEmail );
objEmail = null;
}
if I use it with my ISP on my IIS everything is fine I can send the form
without any problem. When I upload it to my host service (obviously
modifying accordingly the SMTP) I
Server Error in '/' Application.
--------------------------------------------------------------------------------
The transport failed to connect to the server.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: The
transport failed to connect to the server.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x80040213): The transport failed to connect to the server.
etc.etc.
The Hosting Service claims that is my code , but I cannot find anything
wrong with it.( considering that works with my IIS).but I don't like to say
that they are wrong until I am positive that I am not.
Can anybody help me please and give me more information on how to solve this
problem?
thank you in advance for your help