Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

How to make an email function with UCCart ?

Posted 30 Apr 2002 18:48:36
1
has voted
30 Apr 2002 18:48:36 Igor B posted:
I've got a shopping cart that is database driven and at the end a customer has to fill in his personal stuff on checkout.asp. On this page there is also the cartcontent (in a table).
Now I want to "copy" all the content and extract all the customerinfo and put it in a mail that is being mailed to me.
In other words... how to make an email function with UCCart.

How can I pull this off?








Edited by - ornathon on 30 Apr 2002 19:25:06

Edited by - ornathon on 09 May 2002 11:54:41

Replies

Replied 01 May 2002 01:02:06
01 May 2002 01:02:06 Matthijs Horsman replied:
Hi Ornathon,

maybe this one helps...

it real easy...

www.udzone.com/showDetail.asp?TypeId=4&NewsId=1833

Grrrr
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
Replied 02 May 2002 06:12:12
02 May 2002 06:12:12 scre wdanger replied:
Hi,
just add the recordset that contains the information asusual in the body.
Understand otherwise i will send you the code.
Replied 02 May 2002 20:14:51
02 May 2002 20:14:51 Igor B replied:
Are there more sollutions for this problem. O yeah, Screwdanger, if you can send me the code I will be very happy :__)

BTW, this is the site:

//click on cart to put a product in the cart then click on "klaar met winkelen" to proceed.
www.bluestorm.nl/results.asp

//here is the checkout page
www.bluestorm.nl/cart_checkout.asp

form -> action = verwerking.asp (this one is supposed to let me mail everything, but this goes wrong)

btw, and a customer clicks on "order plaatsen" (place order) then the table above and all the info have to be send to me.

Thanx in advance


Edited by - ornathon on 09 May 2002 20:25:25
Replied 13 May 2002 21:36:55
13 May 2002 21:36:55 Igor B replied:
Alrighty, I see you have difficulties aswel with this one. But I came up with a sollution.
I just have to use Jmail to do the job. But for some reason I get error 500 messages. If I check out why, the browser says that the addRecipient function doesn't exist! what!!! Here is the whole code of the action. Do you know if there is something wrong with it? My server has jmail installed btw..

<pre id=code><font face=courier size=2 id=code>
&lt;%
Set jmail = Server.CreateObject("JMail.Message"

jmail.AddRecipient " "
jmail.From = Request.Form("email"
jmail.Sendername = Request.Form("voornaam" & " " & Request.Form("achternaam"

jmail.Subject = "blabla " & Request.Form("voornaam" & " " & Request.Form("achternaam"
jmail.Body = "Voornaam: " & Request.Form("voornaam" &_
"&lt;BR&gt;Achternaam: " & Request.Form("achternaam" &_
"&lt;BR&gt;Adres: " & Request.Form("adres" &_
"&lt;BR&gt;Postcode: " & Request.Form("postcode" &_
"&lt;BR&gt;Woonplaats: " & Request.Form("woonplaats" &_
"&lt;BR&gt;Telefoon: " & Request.Form("telefoon" &_
"&lt;BR&gt;Email: " & Request.Form("email" &_
"&lt;BR&gt;Betalingswijze: " & Request.Form("betalingswijze" &_
"&lt;BR&gt;Opmerkingen: " & Request.Form("opmerkingen" &_
"&lt;BR&gt;&lt;table&gt;"

For i=0 To UCCart1.GetItemCount()-1
jmail.Body = Mail.Body & "&lt;tr bgcolor=""3a577e""&gt;" &_
"&lt;td width=""155"" class=""8white""&gt;" & UCCart1.GetColumnValue("Name",i) & "&lt;/td&gt;" &_
"&lt;td width=""82"" class=""8white""&gt;" & UCCart1.GetColumnValue("Quantity",i) & "&lt;/td&gt;" &_
"&lt;td width=6 class=""8white""&gt;€&lt;/td&gt;" &_
"&lt;td width=79 class=""8white""&gt;" & FormatNumber((UCCart1.GetColumnValue("Price",i)), 2, -2, -2, -2) & "&lt;/td&gt;" &_
"&lt;td width=6 class=""8white""&gt;€&lt;/td&gt;" &_
"&lt;td width=104 class=""8white""&gt;" & FormatNumber((UCCart1.GetColumnValue("Total",i)), 2, -2, -2, -2) & "&lt;/td&gt;"
Next 'volgende i

jmail.Body = jmail.Body & "&lt;/tr&gt;&lt;/table&gt;&lt;BR&gt;&lt;BR&gt;Totaal: " & FormatNumber((UCCart1.GetColumnTotal("Total"), 2, -2, -2, -2)
jmail.Send("mail.blabla.nl"
%&gt;

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;email&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
It is working!!!!
&lt;/body&gt;
&lt;/html&gt;
</font id=code></pre id=code>

Thanx for the help!



Edited by - ornathon on 13 May 2002 21:37:39
Replied 13 May 2002 22:12:15
13 May 2002 22:12:15 Matthijs Horsman replied:
i am not sure but try one time leaving the "" away, that may help....

good luck

Grrrr
Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
Replied 20 May 2002 19:19:36
20 May 2002 19:19:36 Igor B replied:
Ok, still not working. But I manage to get mail in my mailbox using the form. But it doesn't send any content with is. You can only see the form names and no info behind it.
What kinda coding do I have to add in the mail? Something like &lt;%@LANGUAGE="VBSCRIPT"%&gt;? And the recordset of the products, do I have to add that too? And what about the cart behaviour?

O yeah, the Jmail version being used on the server is version 3.

This is my updated code (still not working completely though)

<pre id=code><font face=courier size=2 id=code>&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;%
Set JMail = Server.CreateObject("JMail.SMTPMail"
JMail.ServerAddress = "smtp.blabla.nl"
JMail.Sender = " "
JMail.Sendername = Request.Form("voornaam" & " " & Request.Form("achternaam"
JMail.Subject = "Bluestorm bestelling van " & Request.Form("voornaam" & " " & Request.Form("achternaam"
JMail.AddRecipient (" "
JMail.ContentType = "text/html"
JMail.Body = "Voornaam: " & Request.Form("voornaam" &_
"&lt;BR&gt;Achternaam: " & Request.Form("achternaam" &_
"&lt;BR&gt;Adres: " & Request.Form("adres" &_
"&lt;BR&gt;Postcode: " & Request.Form("postcode" &_
"&lt;BR&gt;Woonplaats: " & Request.Form("woonplaats" &_
"&lt;BR&gt;Telefoon: " & Request.Form("telefoon" &_
"&lt;BR&gt;Email: " & Request.Form("email" &_
"&lt;BR&gt;Betalingswijze: " & Request.Form("betalingswijze" &_
"&lt;BR&gt;Opmerkingen: " & Request.Form("opmerkingen" &_
"&lt;BR&gt;&lt;table&gt;"

For i=0 To UCCart1.GetItemCount()-1
Mail.Body = Mail.Body & "&lt;tr bgcolor=""3a577e""&gt;" &_
"&lt;td width=""155"" class=""8white""&gt;" & UCCart1.GetColumnValue("Name",i) & "&lt;/td&gt;" &_
"&lt;td width=""82"" class=""8white""&gt;" & UCCart1.GetColumnValue("Quantity",i) & "&lt;/td&gt;" &_
"&lt;td width=6 class=""8white""&gt;&euro;&lt;/td&gt;" &_
"&lt;td width=79 class=""8white""&gt;" & FormatNumber((UCCart1.GetColumnValue("Price",i)), 2, -2, -2, -2) & "&lt;/td&gt;" &_
"&lt;td width=6 class=""8white""&gt;&euro;&lt;/td&gt;" &_
"&lt;td width=104 class=""8white""&gt;" & FormatNumber((UCCart1.GetColumnValue("Total",i)), 2, -2, -2, -2) & "&lt;/td&gt;"
Next 'volgende i

Mail.Body = Mail.Body & "&lt;/tr&gt;&lt;/table&gt;&lt;BR&gt;&lt;BR&gt;Totaal: " & FormatNumber((UCCart1.GetColumnTotal("Total"), 2, -2, -2, -2)

JMail.Execute
Set JMail = nothing
Response.Redirect "cart_bedankt.asp"
%&gt; </font id=code></pre id=code>

Replied 20 May 2002 19:24:01
20 May 2002 19:24:01 Matthijs Horsman replied:
Hi Ornathon,

I think that you really have to try the extension by George Petrov.

If you use the extension, you just set up a page like you want your email to look like. Then you van apply the extension and point to the file you just made. Now the page will be send. You can use recordsets and all that stuff in the e-mail...

It's right over here:

www.udzone.com/showDetail.asp?TypeId=4&NewsId=1833

Good luck..

Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
Replied 20 May 2002 22:51:07
20 May 2002 22:51:07 Igor B replied:
Ok thank you. I'll try it out. Still it is weird that UCCArt has no email function... or one that I am not aware of.

Replied 20 May 2002 23:02:05
20 May 2002 23:02:05 Matthijs Horsman replied:
hehe yeah that would be great....

and while they are at it, maube a function that i can send the cart as a excel document... i am gonna try to do that, but that will difficult job...

greetz

Matthijs
----------------
UD4/WY2K/IIS/ASP-VB
www.chaps.nl
Replied 22 May 2002 23:57:12
22 May 2002 23:57:12 Igor B replied:
Ok!!! It is working! I will post the working code for the asp html mail when it is bug-free.
I think many ppl can use it as an example for their own UCCart sites. Thanx for your help.

Reply to this topic