Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.60/5 (2 votes)
See more:
Hi,

Can you please tell me how to call this "Send To" variable in the below code , its throwing some error .

But if i am giving mail address directly i.e objCDOSYSMail. From.From ="example1@domain.com"
its working.

Code-

HTML
<%

Dim SendTo 

SendTo ="mail1@domain.com" 

objCDOSYSMail.From = SendTo 


objCDOSYSMail.To = "example@domain.com"



objCDOSYSMail.Cc="example1@domain.com"


objCDOSYSMail.Bcc="example2@domain.com"


objCDOSYSMail.Subject = "Testing"


objCDOSYSMail.HTMLBody = "Email for Testing Purpose."


objCDOSYSMail.Send

End with

'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing

%>
Posted
Updated 27-Mar-16 9:02am
v2
Comments
CHill60 22-May-15 7:53am    
"throwing some error" - what error precisely?
[no name] 22-May-15 8:18am    
What error?

1 solution

Do not see:

Set objCDOSYSMail= CreateObject("CDONTS.NewMail")
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900