I have the following page on a .NET enabled server which acts as a test mail script. I am attempting to send mail on a much more complex page. When the page executed...nothing happened...no error messages...nothing. So, in an effort to troubleshoot I created this simple test and it seems that I may have found a direction to look in.
<%@dotnet.itags.org. Page Language = "VB" Debug = "True" Explicit = "True" %>
<%@dotnet.itags.org. Import Namespace="System.Web.Mail" %>
<script runat="server">
Sub Page_Load()
Dim mail As New MailMessage()
mail.To = "shane.fowlkes@dotnet.itags.org.drpt.virginia.gov"
mail.From = "webmaster@dotnet.itags.org.drpt.virginia.gov"
mail.Subject = "this is a test email."
mail.BodyFormat = MailFormat.Html
mail.Body = "this is my test email body.< br >< b >this part is in bold< /b >"
SmtpMail.SmtpServer = "localhost" 'your real server goes here
SmtpMail.Send(mail)
End Sub
</script>
The code above gives me the error message "The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for webmaster@dotnet.itags.org.drpt.virginia.gov".
I looked on this helpful site: http://systemwebmail.com/faq/4.3.2.aspx and the second and third bullets on this page seem like they MAY apply. But the trouble is, I don't know if I "have permission to relay through the server" as the pointer tips indicate.
Can anyone shed some light on this or help me out? Thanks in advance!!Sure - here is the jist:
1.) If you site is hosted at www.mySite.com, then by default you should be allowed to send mail to anyone@.mysite.com -- however, if you want to send mail to anyone@.yahoo.com then the server/site must be set up with permissions. You should be able to send a request to your host to set this up (its an smtp setting in IIS)
2.) If its your server then keep in mind that by allowing domains (such as yahoo.com) to have sent, then spammers could potentially use your mail server for their malicious acts.
Let me know if you need further assistance.
Basically what it's telling you is that you're trying to "fake" mail. What's there to stop me from running the same code you posted and send 1,000,000 spam e-mails that look like they came from you?
Try changing localhost to your real mail server you use.
I actually tried that (earlier) and it worked. Thanks everyone.
0 comments:
Post a Comment