A
armando perez
Hi, this is my first time here, but I was looking for something that
may help me, and still, I haven't found something to use.
I'm using a website made in .NET with C#, when I'm running my site from
my PC, everything seems right, but when I publish the website, and send
it to my real website, everything works but the mail sending.
I have red some groups and topics, and everywhere I can found:
- Use the following syntax:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network
host="smtp.yourdomain.com"/>
</smtp>
</mailSettings>
</system.net>
- Or other with some modifications:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network
host="smtp.yourdomain.com" userName="" password="" port="25"/>
</smtp>
</mailSettings>
</system.net>
Even without the port, it works on my PC, but in the real website, it
doesn't.
I'm not sure if something is missing, my local website is running on a
Windows XP professional edition, with .NET Framework 2.0, and the
website is on a Windows 2003 Server, with the .NET client installed.
Somewhere I red that .NET uses proxy configuration from IE, and I can
use IE in the webserver, but it does not use any proxy.
Also, I can send emails in other way, and THAT way is working anyway,
but this mail settings in the web.config file are showing an error
message.
I tried allowing the port in the firewall, but still nothing.
My questions are:
- Can I have this settings on this file working properly by doing
something in the server, or in the website?
- How can I check the commands sent by my website? Maybe if I can see
the real message, I can figure out a way to make it "recognized". (see
the error mesage below)
- Or, otherwise, can I avoid the mail settings in web.config? Because
when I tried to "avoid its use", by deleting the system.net section,
the website, in my PC, shows a message telling me that this section is
needed.
The error message obtained from the real website is the following:
Error: System.Net.Mail.SmtpException: Syntax error, command
unrecognized. The server response was: Unauthorized relay msg rejected
at System.Net.Mail.RecipientCommand.CheckResponse(SmtpStatusCode
statusCode, String response)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender,
MailAddressCollection recipients, String deliveryNotify,
SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String
email, String userName, String password, MailDefinition mailDefinition,
String defaultSubject, String defaultBody, OnSendingMailDelegate
onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate,
Control owner)
at
System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordUserNameView()
at System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword()
at System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object
source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
By the way, sorry for misspellings, I'm not "english borned".
Thanks for your time, any suggestion or answer is welcome.
may help me, and still, I haven't found something to use.
I'm using a website made in .NET with C#, when I'm running my site from
my PC, everything seems right, but when I publish the website, and send
it to my real website, everything works but the mail sending.
I have red some groups and topics, and everywhere I can found:
- Use the following syntax:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network
host="smtp.yourdomain.com"/>
</smtp>
</mailSettings>
</system.net>
- Or other with some modifications:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network
host="smtp.yourdomain.com" userName="" password="" port="25"/>
</smtp>
</mailSettings>
</system.net>
Even without the port, it works on my PC, but in the real website, it
doesn't.
I'm not sure if something is missing, my local website is running on a
Windows XP professional edition, with .NET Framework 2.0, and the
website is on a Windows 2003 Server, with the .NET client installed.
Somewhere I red that .NET uses proxy configuration from IE, and I can
use IE in the webserver, but it does not use any proxy.
Also, I can send emails in other way, and THAT way is working anyway,
but this mail settings in the web.config file are showing an error
message.
I tried allowing the port in the firewall, but still nothing.
My questions are:
- Can I have this settings on this file working properly by doing
something in the server, or in the website?
- How can I check the commands sent by my website? Maybe if I can see
the real message, I can figure out a way to make it "recognized". (see
the error mesage below)
- Or, otherwise, can I avoid the mail settings in web.config? Because
when I tried to "avoid its use", by deleting the system.net section,
the website, in my PC, shows a message telling me that this section is
needed.
The error message obtained from the real website is the following:
Error: System.Net.Mail.SmtpException: Syntax error, command
unrecognized. The server response was: Unauthorized relay msg rejected
at System.Net.Mail.RecipientCommand.CheckResponse(SmtpStatusCode
statusCode, String response)
at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender,
MailAddressCollection recipients, String deliveryNotify,
SmtpFailedRecipientException& exception)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at System.Web.UI.WebControls.LoginUtil.SendPasswordMail(String
email, String userName, String password, MailDefinition mailDefinition,
String defaultSubject, String defaultBody, OnSendingMailDelegate
onSendingMailDelegate, OnSendMailErrorDelegate onSendMailErrorDelegate,
Control owner)
at
System.Web.UI.WebControls.PasswordRecovery.AttemptSendPasswordUserNameView()
at System.Web.UI.WebControls.PasswordRecovery.AttemptSendPassword()
at System.Web.UI.WebControls.PasswordRecovery.OnBubbleEvent(Object
source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String
eventArgument)
at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection
postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
By the way, sorry for misspellings, I'm not "english borned".
Thanks for your time, any suggestion or answer is welcome.