The error I'm getting is "Could not access 'CDO.Message' object."
Now, I'm not sure, but could it have something to do with the fact that my computer is hooked up to a base station (router) that may have the port blocked?
If so, do you know which port/s I should try forwarding?
I could have just F'ed something else up along the way, anyways, if anyone has any ideas, I'd love to hear them.
Thanks in advance,
GrierThis is probably a problem with the security settings in the IIS SMTP service. Have you checked the SMPTSVC log or the Event Viewer for any messages?
I believe 25 is the default port for SMTP. Are you specifying "localhost" as your SmtpMail.SmtpServer?
You are correct. 25 is the default SMTP port.
Could you post some of your code so we can decipher what is going on?
Thanks for the response!!! I have not checked the logs, (not sure if I know how...)
void OnSend (Object sender, EventArgs e)
{
MailMessage message = new MailMessage();message.From = "gallen@.slantmedia.net";
message.To = "gallen@.slantmedia.net";
message.Subject = "Validate This Message";
message.Body = Body.Text;
SmtpMail.SmtpServer = "localhost";try
{
SmtpMail.Send (message);
Label1.Text = "Message Sent!";
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
there is the code I've been using, thanks for taking a look!!!!
G
There are two places to check for logs. The first is the Windows Event Viewer. This can be found under the Administrative Tools. Look in the System log for any events with "SMTPSVC" as the source.
Second you can check the logfile that is generated by the SMTP service. This can be found in %windir%\system32\logfiles\smtpsvc1 by default. This may not provide as much information if you are not very familiar with SMTP.
Your code looks pretty standard so I don't think that the problem rests there. The next thing to look at is the setup for your SMTP service. Normally SMTP servers only allow messages which are addressed to a domain that is hosted by that server. Getting the SMTP server to accept a message from you (or from ASP.NET) and forward on to another mail server is called relaying. You have to configure your server to allow this.
Go to Administrative Tools > Internet Information Services > Default SMTP Virtual Server > (right click) > Properties > Access Tab > Relay. This will open the Relay Restrictions window. Select "only the list below" and then add 127.0.0.1 as an allowed computer. After you have completed this configuration, try running through your code again.
0 comments:
Post a Comment