Forums
This topic is locked
CDO Mail Help
Posted 23 years ago
1
has voted
23 years ago Peter Lent posted:
Ok, I "think" I have a pretty basic CDO mail question.I have a form on page1.asp that submits information to page2.asp (for a receipt)
I want to send an email (with CDO) from page1.asp when the user submits the form to page2.asp.
I already have all the cdo information filled out on page1.asp, but I cannot figure out how to make it execute.
HELP.
THANKS
-Peter
Replies
Replied 23 years ago
23 years ago David Behan replied:
Here is a bit of code I posted on another thread.
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = rsMember.Fields.Item("MEM_EMAIL"
.Value
objCDO.From = "Music Company"
objCDO.Value("Reply-To"
= "
you@musiccompany.com
"
objCDO.Subject = "Hello"
objCDO.Body = "This is the body"
objCDO.Send
Set objCDO = Nothing
If you search this forum for messages by me or cdonts you will find a good view posts of code samples I have thrown up.
Regards
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Set objCDO = Server.CreateObject("CDONTS.NewMail"

objCDO.To = rsMember.Fields.Item("MEM_EMAIL"

objCDO.From = "Music Company"
objCDO.Value("Reply-To"

objCDO.Subject = "Hello"
objCDO.Body = "This is the body"
objCDO.Send
Set objCDO = Nothing
If you search this forum for messages by me or cdonts you will find a good view posts of code samples I have thrown up.
Regards
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 23 years ago
23 years ago Peter Lent replied:
I have all the code the actual email, I just cannot figure out how to make the form submit the data to a page, AND send the email at the same time.
THANKS
-Peter
THANKS
-Peter
Replied 23 years ago
23 years ago David Behan replied:
Here is some code...
' email new affiliate their details
FORM_CONTACT = Request.Form("Contact"
FORM_COMPANY = Request.Form("Company"
FORM_EMAIL = Request.Form("Email Address2"
FORM_IP = Request.Form("IPAddress"
FORM_PASSWORD = Request.Form("Random Password"
FORM_USERNAME = Request.Form("Username"
FORM_LINK = Request.Form("Random Link"
Dim strBody
strBody = strBody & vbCrLf & "=================================" & vbCrLf
strBody = strBody & "HELLO" & vbCrLf
strBody = strBody & "=================================" & vbCrLf & vbCrLf
strBody = strBody & "Dear " & FORM_CONTACT & "," & vbCrLf & vbCrLf
strBody = strBody & "You are receiving this email because you or someone else at IP: " & FORM_IP & " signed " & FORM_COMPANY & " up to our affiliate program on our website." & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "If there is anything else that we can do for, please do not hesitate to contact us." & vbCrLf & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "BYE" & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail"
objCDO.To = FORM_EMAIL
objCDO.From = " myaddress@mysite.com "
objCDO.Subject = "Hello"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
%>
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
' email new affiliate their details
FORM_CONTACT = Request.Form("Contact"

FORM_COMPANY = Request.Form("Company"

FORM_EMAIL = Request.Form("Email Address2"

FORM_IP = Request.Form("IPAddress"

FORM_PASSWORD = Request.Form("Random Password"

FORM_USERNAME = Request.Form("Username"

FORM_LINK = Request.Form("Random Link"

Dim strBody
strBody = strBody & vbCrLf & "=================================" & vbCrLf
strBody = strBody & "HELLO" & vbCrLf
strBody = strBody & "=================================" & vbCrLf & vbCrLf
strBody = strBody & "Dear " & FORM_CONTACT & "," & vbCrLf & vbCrLf
strBody = strBody & "You are receiving this email because you or someone else at IP: " & FORM_IP & " signed " & FORM_COMPANY & " up to our affiliate program on our website." & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "If there is anything else that we can do for, please do not hesitate to contact us." & vbCrLf & vbCrLf & vbCrLf & vbCrLf
strBody = strBody & "BYE" & vbCrLf
Set objCDO = Server.CreateObject("CDONTS.NewMail"

objCDO.To = FORM_EMAIL
objCDO.From = " myaddress@mysite.com "
objCDO.Subject = "Hello"
objCDO.Body = strBody
objCDO.Send
Set objCDO = Nothing
%>
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2