Reply
send order.asp
Old 03-14-2005, 07:16 AM send order.asp
Junior Talker

Posts: 4
Hi all, this is my first post so please excuse any ignorance...

I am working on a website that has a shopping cart. The order for the cart is generated using javascript and SQL on as ASP page. No problems yet.

The problem is with sending the order as an email to the company.

The (abbreviated) code is below, the variables: (email, subject, message, order_id, etc..) are all getting assigned values appropriately.

Here's the main code I'm concerned with:


<%@ Language=JScript %>
<%

con = db_connect_ ();
con.Execute (...some SQL...);
rs = con.Execute (...more SQL...);

con = db_connect_ ();
rs.Close ();
con.Close ();

mail = Server.CreateObject ("CDONTS.NewMail");
mail.Subject = "Order #" + order_id + "\n";
mail.From = name + "@seauto.com";
mail.To = "cort@mrexcel.com";
mail.Cc = email;
mail.Body = mail_body;
mail.Send();
%>

<?php
// Your email address
$email = "cort@mrexcel.com";
// The subject
$subject = "Enter your subject here";
// The message
$message = "Enter your message here";
mail($email, $subject, $message, "From: $email");
echo "The email has been sent.";
?>


The mail.send() command is just not working.
No errors are produced, but no email is sent. I've researched this a bunch, and it seems windows XP doesn't support the CDONTS mail object. I read you can use 'jmail', but I don't understand how to "register the class" on my server. I would rather use PHP, you can see my attempt at the end of the code segment, but that doesn't work either.

Any suggestion? ...I'm desparate.
All I need to do is send an email with the values of the above-listed variables in the email.

Many thanks,
Cort
MrExcel.com
Cort is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 03-14-2005, 10:28 AM
vivekar's Avatar
Webmaster Talker

Posts: 531
Which smtp server you are using? Check whether you have permissions to send mail.

If you want to try in PHP use the PHPMailer component.
http://phpmailer.sourceforge.net/
http://phpmailer.sourceforge.net/tutorial.html

Hope that helps.

To register Jmail, you have to
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Old 03-14-2005, 11:04 AM
Junior Talker

Posts: 4
Thanks for the quick reply vivekar,

I should have email permission, I use a PHP form for feedback elsewhere on the site and it works correctly.

Also, could you please repost your link for how to register the jmail clasee on my server, the link seems to have vanished...

Thanks.
Cort is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to send order.asp
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11981 seconds with 13 queries