|
| |
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
Notification of Page Access - Godaddy Host - 10/5/2007 11:16:26
Hi, I have been using the following code to alert me when I have a pending item by sending me an email when some gets to my "thankyou.asp" page. This has worked well up until recently when I switched my site over to godaddy and now I am no longer getting the emails letting me know I need to OK an event. <% Dim stname,st stname = "mysite.com Has Received a calendar request for approval" st = Request.Form("st") Dim ObjMail Set ObjMail = Server.CreateObject("CDONTS.NewMail") ObjMail.To = "me@mysite.com " ObjMail.From = "me@mysite.com " ObjMail.Subject = "Website - Calendar Event pending for mysite.com " ObjMail.Body = stname & vbcrlf&_ st ObjMail.Send Set ObjMail = Nothing %> After some web searching someone stated with godaddy I need to add the line SmtpMail.SmtpServer = "relay-hosting.secureserver.net" but I have tried it in several places in my statement with no luck. Any ideas???
|
|
|
|
William Lee
Posts: 1179 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 11:20:41
Have you checked with godaddy which ASP email component they support? Your script is CDONT, the one recommended to you is smtpmail.
_____________________________
William Lee pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 11:29:01
The only info I could find on Godaddy stated Use the following relay server in your ASP CDONTS code: relay-hosting.secureserver.net You do not need to provide a user name and password for this relay server. http://help.godaddy.com/article.php?article_id=956&topic_id=100
|
|
|
|
William Lee
Posts: 1179 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 11:39:36
I remembered somewhere that Godaddy works with CDOSYS and not very well with CDONTS. Are you able to check with them on this?
_____________________________
William Lee pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ
|
|
|
|
William Lee
Posts: 1179 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 11:48:38
I found this link http://help.godaddy.com/article.php?article_id=1073&topic_id=216
_____________________________
William Lee pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 12:22:06
Ok, this is the part where my inexperience shows. Will i be able to embed this code into my asp doc like; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> // language -- C# // import namespace using System.Web.Mail; private void SendEmail() { const string SERVER = "relay-hosting.secureserver.net"; MailMessage oMail = new System.Web.Mail.MailMessage(); oMail.From = "emailaddress@domainname"; oMail.To = "emailaddress@domainname"; oMail.Subject = "Test email subject"; oMail.BodyFormat = MailFormat.Html; // enumeration oMail.Priority = MailPriority.High; // enumeration oMail.Body = "Sent at: " + DateTime.Now; SmtpMail.SmtpServer = SERVER; SmtpMail.Send(oMail); oMail = null; // free up resources } </body> </html>
|
|
|
|
William Lee
Posts: 1179 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 12:25:26
quote:
ORIGINAL: Mav44 Ok, this is the part where my inexperience shows. Will i be able to embed this code into my asp doc like; <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> // language -- C# // import namespace using System.Web.Mail; private void SendEmail() { const string SERVER = "relay-hosting.secureserver.net"; MailMessage oMail = new System.Web.Mail.MailMessage(); oMail.From = "emailaddress@domainname"; oMail.To = "emailaddress@domainname"; oMail.Subject = "Test email subject"; oMail.BodyFormat = MailFormat.Html; // enumeration oMail.Priority = MailPriority.High; // enumeration oMail.Body = "Sent at: " + DateTime.Now; SmtpMail.SmtpServer = SERVER; SmtpMail.Send(oMail); oMail = null; // free up resources } </body> </html> You forgot the ASP tags. <% blah..blah.... ..... .... %>
_____________________________
William Lee pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 13:05:22
William, Thanks for hanging in there with me I know I must be getting close. I tried the example below and I get an error message. I have also tried replacing the { with <% and I get an error message. What am I missing? <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <% // language -- C# // import namespace using System.Web.Mail; private void SendEmail() { const string SERVER = "relay-hosting.secureserver.net"; MailMessage oMail = new System.Web.Mail.MailMessage(); oMail.From = "emailaddress@domainname"; oMail.To = "emailaddress@domainname"; oMail.Subject = "Test email subject"; oMail.BodyFormat = MailFormat.Html; // enumeration oMail.Priority = MailPriority.High; // enumeration oMail.Body = "Sent at: " + DateTime.Now; SmtpMail.SmtpServer = SERVER; SmtpMail.Send(oMail); oMail = null; // free up resources } %> </body> </html>
|
|
|
|
William Lee
Posts: 1179 Joined: 1/25/2002 From: Singapore Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 13:07:54
What error msg was generated?
_____________________________
William Lee pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 13:19:26
When I try and pull up the page I get: Microsoft VBScript compilation error '800a0401' Expected end of statement /email1.asp, line 13 using System.Web.Mail; ---------------------^
|
|
|
|
ou812
Posts: 1602 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 13:25:50
It looks like you're trying to use ASP.NET, C#, and not ASP. Here's an ASP example: http://www.aspdev.org/articles/asp-cdosys/
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 13:32:53
I tried the site above and came up with the code below but now I get an error message: error '8004020f' /email1.asp, line 26 New Code ------------------------------------------------------------------------------------------------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <% Set oMail = Server.CreateObject("CDO.Message") Set oMailConfig = Server.CreateObject ("CDO.Configuration") oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 oMailConfig.Fields.Update Set oMail.Configuration = oMailConfig oMail.From = "admin@mysite.com" oMail.To = "admin@mysite.com" oMail.Subject = "Here goes the email subject..." oMail.HTMLBody = "Here goes the email body..." oMail.Send Set oMail = Nothing Set oMailConfig = Nothing %> </body> </html>
|
|
|
|
ou812
Posts: 1602 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 14:08:18
The error number usually means the server is rejecting the email for some reason. I would first try making sure your "from" address is from your domain. Your host probably doesn't allow from's from other domain names (to help prevent spammers). While you're at it I would also supply a valid "To" address. Let us know how it goes after this.
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 14:18:27
I tried a couple of different addresses in both the TO and FROM and it did not change the error code. All of the addresses I used were in the same domain as the page.
|
|
|
|
ou812
Posts: 1602 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 14:21:03
I've not used CDOSYS in quite some time, so not sure what the extra configuration settings are for. Can you try a simpler example and see what happens, substituting your domain names etc. Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="someone@somedomain.com" myMail.TextBody="This is a message." myMail.Send set myMail=nothing
_____________________________
-brian EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 15:49:01
Interesting, no error messages this time but I did not receive any email either. I wonder if Godaddy is blocking this email or I need to incorporate the SmtpMail.SmtpServer = "relay-hosting.secureserver.net" statment into this code for this page to be able to send the email?
|
|
|
|
Mav44
Posts: 122 Joined: 6/25/2006 Status: offline
|
RE: Notification of Page Access - Godaddy Host - 10/5/2007 20:04:56
Spooky to the rescue! I want to thank everybody who helped me on this one as my page and email notification is working like a charm! I have posted my final code below for any who follow this post looking for an answer as it looks like GoDaddy is not real clear on this issue. Thanks again everyone!!! -------------------------------------------------------------------------------------------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <% Set oMail = Server.CreateObject("CDO.Message") Set oMailConfig = Server.CreateObject ("CDO.Configuration") oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net" oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 oMailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 oMailConfig.Fields.Update Set oMail.Configuration = oMailConfig oMail.From = "ME@MYSITE.com" oMail.To = "ME@MYSITE.com" oMail.Subject = "Here goes the email subject..." oMail.HTMLBody = "Here goes the email body..." oMail.Send Set oMail = Nothing Set oMailConfig = Nothing %> </body> </html>
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|