Author Topic: Need help sending email from webpage  (Read 3996 times)

timkool

  • Visitor
  • *
  • Posts: 3
    • View Profile
    • Email
Need help sending email from webpage
« on: 2009-05-15, 05:57:17 AM »
Hi,
I am trying to send emails from my asp page with cdo but keep getting the following error:

"An error occurred on the server when processing the URL. Please contact the system administrator."

The host of the website is btconnect and i have phoned them to check the server settings which they say are correct. My code is as follows:

Code:

Set oMail = Server.CreateObject("CDO.Message")
   Set iConf = Server.CreateObject("CDO.Configuration")
   Set Flds = iConf.Fields
   iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
   iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.btconnect.com"
   iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
   iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

   iConf.Fields.Update
   Set oMail.Configuration = iConf
   oMail.To       = "kudutravel@btconnect.com"
   oMail.From       = "kudutravel@btconnect.com"
   oMail.Subject       = "Test"
   oMail.HTMLBody       = "Test Message"
   
   oMail.Send
   Set iConf = Nothing
   Set Flds = Nothing

Any help or advice would be appreciated

Regards
JD




www.floatingtank.at
methadrostenol

dutch_619

  • Regular
  • **
  • Posts: 90
    • View Profile
    • Email
Re: Need help sending email from webpage
« Reply #1 on: 2009-05-15, 09:15:55 AM »
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="Some String here"
myMail.To="kudutravel@btconnect.com"
myMail..HTMLBody ="This is a message."
myMail.Send
set myMail=nothing
%>