Wats the error in this code

R

Rajani

Hello,

dim receiptto
receiptto="(e-mail address removed)"
set cdoconfig=CreateObject("CDO.configuration")
set cdomsg=CreateObject("CDO.Message")

with cdoconfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

..Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="mail8.webmail.com"

'this is the SMTP server setting in my outlook.

.Update
end with
with cdomsg
set .Configuration=cdoconfig

..Fields("urn:schemas:mailheader:disposition-notification-to")=receiptto
.Fields("urn:schemas:mailheader:return-receipt-to") =receiptto
.From="(e-mail address removed)"
.To="(e-mail address removed)"
.Subject="Sample mail"
.HTMLBody="<b><font color=#ff0000 size=3
face='arial'>Hello</font></b>"
.DSNOptions=4
.Fields.update
.Send
end with
set cdoconfig=nothing
set cdomsg=nothing


Response.Write "Mail sent"


I am getting the error ar .Send (Internal Server error 500
If i didnt use configuration, sending mail correctly. (Simple from, to,
subject, htmlbody, send).


Thanx in advance
 
R

Rajani

Hello,

I off friendly error messages in the browser. Still the same
error(screen). I copied from that article only and changed values to suit my
requirements. If i didnt use configuration, its sending mail w/o error. When
i use config only its displaying error.
 
J

Jason Brown [MSFT]

yeah mate.


--
Jason Brown
Microsoft GTSC, IIS

This posting is provided "AS IS" with no warranties, and confers no
rights.
 
J

Jeff Cochran

I off friendly error messages in the browser. Still the same
error(screen). I copied from that article only and changed values to suit my
requirements. If i didnt use configuration, its sending mail w/o error. When
i use config only its displaying error.

Post the full error message as you see it. If it works without the
config, then you have something wrong in your config settings. You
did edit the code to match your SMTP server, correct?

Jeff
 
R

Rajani

This is the code i used
dim receiptto
receiptto="(e-mail address removed)"
set cdoconfig=CreateObject("CDO.configuration")
set cdomsg=CreateObject("CDO.Message")

with cdoconfig.Fields
' .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
' .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="mail4.webindia.com"
' .Update
end with
with cdomsg
' set .Configuration=cdoconfig
.Fields("urn:schemas:mailheader:disposition-notification-to")=receiptto
.Fields("urn:schemas:mailheader:return-receipt-to") =receiptto
.From="(e-mail address removed)"
.To="(e-mail address removed)"
.Subject="Sample mail"
.HTMLBody="<b><font color=#ff0000 size=3 face='arial'>Hello</font></b>"
.DSNOptions=4
.Fields.update
.Send
end with
set cdoconfig=nothing
set cdomsg=nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top