Am sending email using CDOSYS and finding that it works ok with a hard coded email address in the TO field but it doesn't work when I use a variable.

This works... ObjSendMail.To = "myEmail@some.com" This doesn't work... ObjSendMail.To = strEmail giving an error...

Microsoft VBScript compilation error '800a0401'
Expected end of statement
/file.asp, line 287
ObjSendMail.To = strEmail

Any clues?

Problem solved. The error was in preceding lines... trying to do too many things in the one routine.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.