5 Replies - 528 Views - Last Post: 28 August 2017 - 04:39 AM Rate Topic: -----

#1 gussy81  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 164
  • Joined: 24-February 15

error send email with ASP

Posted 28 August 2017 - 02:24 AM

had a bit of code working on IIS but have moved it to a hosted server. i get the following error now for sending an email:

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

/wptest/PaymentResponse error.asp, line 91



this my code:

<%
End If
StrMailBody = "Time Stamp: " & timestamp & vbCrLf & "Amount Paid: " & Amount & vbCrLf & "Matter Reference: " 
StrMailBody = StrMailBody & Comment_2 & vbCrLf & "Matter Name: " & Comment_1  & vbCrLf & "Authorisation Code: " & authcode
StrMailBody = StrMailBody & vbCrLf & "Order ID: " & orderid  & vbCrLf & "Result: " & result


Set MailObj = Server.CreateObject("CDO.Message")
MailObj.From = "[email protected]"
MailObj.To = "[email protected]"
MailObj.Subject = strMailSubject
MailObj.TextBody = strMailBody


MailObj.Send


%>



i have played around with the server.createObject line but with no joy. line 91 is this: MailObj.Send

thanks
G

This post has been edited by gussy81: 28 August 2017 - 02:25 AM


Is This A Good Question/Topic? 0
  • +

Replies To: error send email with ASP

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4136
  • View blog
  • Posts: 13,058
  • Joined: 08-June 10

Re: error send email with ASP

Posted 28 August 2017 - 02:40 AM

What is the SendUsing config value you're using?

https://msdn.microso...=exchg.10).aspx
Was This Post Helpful? 0
  • +
  • -

#3 gussy81  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 164
  • Joined: 24-February 15

Re: error send email with ASP

Posted 28 August 2017 - 03:10 AM

hi Dormilich,

new to ASP so i am not sure to be honest
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 4136
  • View blog
  • Posts: 13,058
  • Joined: 08-June 10

Re: error send email with ASP

Posted 28 August 2017 - 03:13 AM

Then it's likely you haven't set it at all. You either have to set it manually, or update the configuration to include the appropriate value. For the latter, ask your provider, how to do that.
Was This Post Helpful? 0
  • +
  • -

#5 gussy81  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 164
  • Joined: 24-February 15

Re: error send email with ASP

Posted 28 August 2017 - 03:20 AM

ok thank you i will ask.


regards
g
Was This Post Helpful? 0
  • +
  • -

#6 gussy81  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 164
  • Joined: 24-February 15

Re: error send email with ASP

Posted 28 August 2017 - 04:39 AM

ok so i changed my code to this after speaking with hosting company as they say all is good on the configuration file....

Set objCDOConf = Server.CreateObject ("CDO.Configuration")
' ** SET AND UPDATE FIELDS PROPERTIES **
With objCDOConf
    ' ** OUT GOING SMTP SERVER **
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
	.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "b......"
    ' ** SMTP PORT **
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
    ' ** CDO PORT **
    .Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    ' ** TIMEOUT **
    .Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    .Fields.Update 
	

End With


Set objMail = Server.CreateObject("CDO.Message")

' ** UPDATE THE CDOSYS CONFIGURATION **
Set objMail.Configuration = objCDOConf

objMail.From = "[email protected]"
objMail.To = "[email protected]"
objMail.Subject = strMailSubject
objMail.htmlBody = strMailBody
objMail.send

Set objCDOConf = Nothing
set objMail = Nothing

%>



but i still get this error: error '8004020e'


but i cant see what the issue is
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1