Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put content of web page in email

Status
Not open for further replies.

zhongwei

Programmer
Jan 25, 2002
30
0
0
CA
I was writing a program about online shoping,when the customer submit the form,we send the email to their email address to confirm their order.does anyone know how to convert the content of web page in email? Thanks for any hints and suggestion.Your help will be appreciated very much.
 
----------------------------------------------------------
Set MyCDONTSMail = CreateObject("CDONTS.NewMail")
MyCDONTSMail.From= "yourname@anywhere.com"
MyCDONTSMail.To= "yourname@anywhere.com"
MyCDONTSMail.Subject="Company Store Purchase"
MyBody = "Hello, this is " & session("first_name") & " " & session("last_name") & vbCrLf
MyBody = MyBody & "I would like to make a purchase from your Store" & vbCrLf
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set MyCDONTSMail=nothing

----------------------------------------------------------
That is a basic example. This uses the CDONTS mail object to send the mail.

E-Z-E
 
Hi,E-Z-E
I'm not familiar with CDNOTS mail object,
Do i need to install some stuff to support it?While I try to run this sample ,the message said
"MyCDONTSMail.From=...." has invalid character.
Do you have any idea about it?
Thanks for your help!
 
zhongwei,

if you just copied and pasted from what I had written above, it may not work because some invalid characters may have gone across with it. I copied and pasted it out of there and gog the same error. You might just want to type the code out, that will fix that error, ironically. But they way it is displayed above should work fine as long as you replace yourname@anywhere.com with your own email address. You do have to have smtp installed for it to work. Let me know how it goes.

E-Z-E
 
Hi,E-Z-E
I type in the code again,and run it .this time no errors, but 30 minutes passed , I didn't find email in my inbox.I double checked my email address ,internet ,server everything is ok,I send email to myself, I got it.but sending through asp code ,it doesn't work.I don't know where the problem is.pls give some suggestion. Thanks!
 
zhongwei,

OK, the problem is in your smtp configuration. Have you looked at your settings for SMTP in IIS? Assuming that it is set up in IIS and says it is running....

Your permissions for the SMTP directory may not allow what NT refers to as "IUSR" to write to it. You actually have to give "IUSR" write permissions on that directory in order for the email to go through. The SMTP folder is the mailroot folder located here.

C:\InetPub\mailroot
Any email that comes to it and never goes through usually gets tossed into the "BadMail" directory.

This may not fix your problem, but it is another step. In general, SMTP can be a royal pain if you are just starting out using it. :(

E-Z-E
 
Hi,Ezzeee
I check C:\InetPub\mailroot,all the emails I send is in Queue folder.
I think the SMTP doesn't set up approiately,I have no experience in set smtp in IIs , could you give me some hint?((my OS is Win2000), Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top