hi there
using ASP.NET/vb.net
i am trying to send mail. I am running Windows Server 2003, with IIS6 and has the smtp mail service installed, and configured
however, i get an error when pressing the submit button to send mail
"Could not access 'CDO.Message' object"
?
what does this mean? I have given the message object the name of the server...but this is what the error is
any ideas?System.Web.Mail...?
publicstaticvoid Send(System.Web.Mail.MailMessage msg, string server)
{
if(msg.Subject == null || msg.Subject == ""){msg.Subject = "News From PK Promotions";}
if(msg.From == null|| msg.From == ""){msg.From = "\"PK Promo\" <mailman@.pkpromo.com>";}
if(msg.From == "mailman@.pkprom.com"){msg.From= "\"PK Promo\" <mailman@.pkpromo.com>";}
System.Web.Mail.SmtpMail.SmtpServer = server;
System.Web.Mail.SmtpMail.Send(msg);
}
C# sorry but you should get the idea. I just pass a msg and server. I actually have this wrapped with the server set....
System.Environment.MachineName
that is what i really have... but dont work :(
Who host your site? If the server isn't configured to relay properly it will fail. But, it not finding the object is strange. I thought it came installed on 2003.
i am configuring the server. on my own local box
this is the error i get in the innerexception:
Message "The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for user@.domain.com
i did a google, and it came up with a fix from MS website, i applied the fix but didnt fix it - or something wrong somewhere in the code.
I have 2 boxes, one is my dev box, the other is the smtp and SQL server. I installed IIS6 with SMTP and configured it... i made sure that the smarthost is the name of the local box - still no luck :(
what can be done?
ok i think i fixed it, had to configure the server to allow relay from all servers apart from a selected range
however, it does not seem to send an email - it succeds in sending the email (apperently) from vb.net but i get no email! :(
this is using SMTP server in IIS6 Windows Server 2003
had this problem and I had to just play with the setting on the smtp to get it working. Then I had problems with the mail I sent getting marked as junk by msn, yahoo,....
Oh. Be sure to use the Allow in this list. I tried the other way and bots on the outside found my server and used it to relay porn to mask where it was coming from. I was sending 1000 of porn a sec. I only knew because of my virus scanner;it got locked up.
I have the doman I am using in the from field in my allow list.
I just ran into a similar problem yesterday. My app seemed to send email to the smtp server just fine, but the emails never arrived. Took a look and in ...\Inetpub\mailroot\Queue on the mail server were all my emails. Talked to the network guys, and apologies I don't know exactly what they did, but it had something to do with the smtp server not being able to send out the emails. Port wasn't open or something.
Look to see if you've got messages waiting to be sent.
0 comments:
Post a Comment