|
 |
asp_web_howto thread: send mail with asp/vbscript
Message #1 by "Joerk Oosterlaande" <mastahj@h...> on Fri, 19 Jul 2002 14:49:06
|
|
Hi I need to send a mail with a file that I create with asp...
Is this possible and how do I do that?
Please reply... I need it now.
Message #2 by "Drew, Ron" <RDrew@B...> on Fri, 19 Jul 2002 10:00:32 -0400
|
|
Here is an example of a customer registration email...as far as
attachments..I do not use them with email as many systems do not except
attachments...
<%@ Language=3DVBScript %>
<html><head><title>customer registration info</title></head>
<body>
<form action=3D"cusInfo.asp" name=3DForm1 method=3Dpost>
Name<input type=3Dtext name=3Dname>
Address<input type=3Dtext name=3Daddress>
Telephone<input type=3Dtext name=3Dphone>
Email<input type=3Dtext name=3Demail>
<input type=3Dsubmit name=3Dsubmit value=3DSubmit>
</form>
<%
if Request.Form("name") <> "" then
dim TitleName
dim TitleAddress
dim TitlePhone
dim TitleEmail
dim strName
dim strAddress
dim strPhone
dim strEmail
dim Body
dim objEmail
TitleName=3D"Full Name"
TitleAddress=3D"Address"
TitlePhone=3D"Phone Number"
TitleEmail=3D"Email Address"
strName=3DRequest.Form("name")
strAddress=3DRequest.Form("address")
strPhone=3DRequest.Form("phone")
strEmail=3DRequest.Form("email")
Body =3D TitleName & ": " & strName & vbCrLf & TitleAddress & ": " &
strAddress & vbCrLf & TitlePhone & ": " & strPhone & vbCrLf & TitleEmail
&
": " & strEmail
%>
<%
set objEmail =3D CreateObject("CDONTS.NewMail")
objEmail.Subject=3D"Customer Registration Info"
objEmail.From=3D"aleahy@t..."
objEmail.To=3D"aleahy@t..."
objEmail.Body=3DBody
objEmail.Send
set objEmail =3D nothing
end if
%>
</body>
</html>
-----Original Message-----
From: Joerk Oosterlaande [mailto:mastahj@h...]
Sent: Friday, July 19, 2002 10:49 AM
To: ASP Web HowTo
Subject: [asp_web_howto] send mail with asp/vbscript
Hi I need to send a mail with a file that I create with asp... Is this
possible and how do I do that? Please reply... I need it now.
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #3 by "Joerk Oosterlaande" <mastahj@h...> on Mon, 22 Jul 2002 14:28:39
|
|
Thanks a lot. It seems to work...
If you're interrested attachments are added with:
AttachFile
with source as object or file.
/ Joerk
> Here is an example of a customer registration email...as far as
attachments..I do not use them with email as many systems do not except
attachments...
<%@ Language=3DVBScript %>
<html><head><title>customer registration info</title></head>
<body>
<form action=3D"cusInfo.asp" name=3DForm1 method=3Dpost>
Name<input type=3Dtext name=3Dname>
Address<input type=3Dtext name=3Daddress>
Telephone<input type=3Dtext name=3Dphone>
Email<input type=3Dtext name=3Demail>
<input type=3Dsubmit name=3Dsubmit value=3DSubmit>
</form>
<%
if Request.Form("name") <> "" then
dim TitleName
dim TitleAddress
dim TitlePhone
dim TitleEmail
dim strName
dim strAddress
dim strPhone
dim strEmail
dim Body
dim objEmail
TitleName=3D"Full Name"
TitleAddress=3D"Address"
TitlePhone=3D"Phone Number"
TitleEmail=3D"Email Address"
strName=3DRequest.Form("name")
strAddress=3DRequest.Form("address")
strPhone=3DRequest.Form("phone")
strEmail=3DRequest.Form("email")
Body =3D TitleName & ": " & strName & vbCrLf & TitleAddress & ": " &
strAddress & vbCrLf & TitlePhone & ": " & strPhone & vbCrLf & TitleEmail
&
": " & strEmail
%>
<%
set objEmail =3D CreateObject("CDONTS.NewMail")
objEmail.Subject=3D"Customer Registration Info"
objEmail.From=3D"aleahy@t..."
objEmail.To=3D"aleahy@t..."
objEmail.Body=3DBody
objEmail.Send
set objEmail =3D nothing
end if
%>
</body>
</html>
-----Original Message-----
From: Joerk Oosterlaande [mailto:mastahj@h...]
Sent: Friday, July 19, 2002 10:49 AM
To: ASP Web HowTo
Subject: [asp_web_howto] send mail with asp/vbscript
Hi I need to send a mail with a file that I create with asp... Is this
possible and how do I do that? Please reply... I need it now.
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |