Ninjakreborn Posted September 10, 2009 Share Posted September 10, 2009 I hate asp. <!-- #include file="common.asp" --> <% contact = rq("contact") bname = rq("bname") email = rq("email") comments = rq("comments") ' Set the mail server configuration Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From=email myMail.To="###########" myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="relay-hosting.secureserver.net" 'myMail.Configuration.Fields.Item _ '("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 myMail.Configuration.Fields.Update myMail.TextBody=comments myMail.Send response.redirect "contact.asp?msg=sent" %> Why isn't this sending. This is straight off the examples presented at www.w3schools.com and various other tutorials..Plus code presented on Godaddy's own knowledge base. This should very simply send an email. Instead it's returning: error '80040211' /docontact.asp, line 22 Any advice? Line 22, by the way, is the "myMail.Send" line. Quote Link to comment https://forums.phpfreaks.com/topic/173832-asp-cdo-mail/ Share on other sites More sharing options...
trq Posted September 11, 2009 Share Posted September 11, 2009 I think you should be getting a syntax error even before then. As far as I remember you cannot use the line continuation _ to split a method and its arguments like that. eg; Change... myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 to myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 You should also try changing that value above from 2 to 1 depending on where your mail server is hosted. (locally or remote) Quote Link to comment https://forums.phpfreaks.com/topic/173832-asp-cdo-mail/#findComment-916541 Share on other sites More sharing options...
KevinM1 Posted September 11, 2009 Share Posted September 11, 2009 Any reason why you're using classic ASP instead of ASP.NET? Quote Link to comment https://forums.phpfreaks.com/topic/173832-asp-cdo-mail/#findComment-916844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.