Can't Send Email in Asp.net

Status
Not open for further replies.

lc2009

New Member
Messages
3
Reaction score
0
Points
0
Hi,everyone:

On my local machine,the asp.net program CAN send emails.BUT on x10hosting server,the SAME PROGRAM,with the SAME EMAIL ACCOUNT.it doesn't.I have tried many times.

Is it allowed to send emails in Asp.net?
If yes,what's the problem?
If no,:dunno:

Thanks.


errors following:
Thread was being aborted

Description: HTTP 500. Error processing request.
Stack Trace:
System.Threading.ThreadAbortException: Thread was being aborted at ASP.sendemail_aspx.btnSend_Click (System.Object sender, System.EventArgs e) [0x00000] at System.Web.UI.WebControls.Button.OnClick (System.EventArgs e) [0x00000] at System.Web.UI.WebControls.Button.RaisePostBackEvent (System.String eventArgument) [0x00000] at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (System.String eventArgument) [0x00000] at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, System.String eventArgument) [0x00000] at System.Web.UI.Page.RaisePostBackEvents () [0x00000] at System.Web.UI.Page.ProcessRaiseEvents () [0x00000] at System.Web.UI.Page.InternalProcessRequest () [0x00000] at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Hi lc2009,

Check http://www.mono-project.com/MoMA and parse your ASP.NET website with it to check if it's compatible. Mono is the .net emulator we use to host asp.net websites.

- xav0989
 

lc2009

New Member
Messages
3
Reaction score
0
Points
0
Hi lc2009,

Check http://www.mono-project.com/MoMA and parse your ASP.NET website with it to check if it's compatible. Mono is the .net emulator we use to host asp.net websites.

- xav0989


Thanks for your reply,I have used MoMA to check the code,and got a single "Todo" method,but it never be called when sending emails.I think it's not the problem.the method marked "Todo" is

void SmtpClient.set_EnableSsl (bool)


The code to send emails is so simple,following:

string to = tbReceiver.Text;
string from = tbFrom.Text;
string subject = tbMailSubject.Text;
string body = tbContent.Text;
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(tbSMTPServer.Text, int.Parse(tbSMTPPort.Text));
client.Credentials = new System.Net.NetworkCredential(tbAccountName.Text, tbAccountPassword.Text);
client.Send(message);

Thanks again for your reply,and letting me know the useful tool MoMA.
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
you can probably only use localhost since i believe all other outgoing mail traffic would be blocked
 
Last edited:

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
Thanks for your reply,I have used MoMA to check the code,and got a single "Todo" method,but it never be called when sending emails.I think it's not the problem.the method marked "Todo" is

void SmtpClient.set_EnableSsl (bool)


The code to send emails is so simple,following:

string to = tbReceiver.Text;
string from = tbFrom.Text;
string subject = tbMailSubject.Text;
string body = tbContent.Text;
MailMessage message = new MailMessage(from, to, subject, body);
SmtpClient client = new SmtpClient(tbSMTPServer.Text, int.Parse(tbSMTPPort.Text));
client.Credentials = new System.Net.NetworkCredential(tbAccountName.Text, tbAccountPassword.Text);
client.Send(message);

Thanks again for your reply,and letting me know the useful tool MoMA.
On the MoMA website, I found this about the todo tag
MonoTodo

Methods marked with [MonoTodo] may or may not cause problems for your application. Sometimes a method may be marked with this to remind a developer that some small part is not implemented or to clean it up later. Other times, the method may not be implemented at all and simply will not perform any function. This is generally done to make an application compile and run, even if it missing some functionality.
The detail report may list a specific reason why the method is marked with [MonoTodo]. Going forward, it has been requested that any developer who uses [MonoTodo] provide a reason that can be used for this report. However, numerous pre-existing tags do not have this reason.
What to do:
These can probably be ignored in your initial porting. Your application should still run without crashing, however there may be missing functionality. Missing functionality can be fixed by working around Mono's unfinished method, implementing the method yourself, or waiting until the method is completed in Mono.


-xav0989
 

lc2009

New Member
Messages
3
Reaction score
0
Points
0
supermatthew is RIGHT.

I set up a smtp server on my local machine using both 80 port and 25 port,and the program in x10hosting can send emails using 80 port.BUT,using 25 port, it can't.

So,The problem is not in the program.

And,dear administrators,Could you unlock the ports. e.g. 25 port.

Thanks.
 
Status
Not open for further replies.
Top