1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
| 'Envoie Email'
On error resume next
Dim mySmartMail
Set mySmartMail = Server.CreateObject("aspSmartMail.SmartMail")
' Mail Server
' ***********
mySmartMail.Server = "localhost"
mySmartMail.ContentType = "text/html"
' From
' ****
mySmartMail.SenderName = nom
mySmartMail.SenderAddress = email
' To
' **
mySmartMail.Recipients.Add "admin@truc.com", "truc.com"
' Parameter
' *********
mySmartMail.Priority = 1
' Message
' *******
mySmartMail.Subject = "COMMANDE truc.com Numero : "&numcommande
mySmartMail.Body = "<table border=1 bordercolor=black cellpadding=2 cellspacing=2 width=600><tr><td><font face=Arial size=2>Référence de la commande :" & numcommande &"<br><br>Référence de la commande interne :"& numinterne &"<br>Société :"& intitule &"<br>Nom :"& nom &"<br>Prénom :"& prenom &"<br>adresse :"& adresse &"<br>cp :"& cp &"<br>ville :"& ville &"<br>tel :"& tel &"<br>email :"& email &"</font></td><td><font face=Arial size=2>ADRESSE de LIVRAISON<br><br>intitule :"& int2 &"<br>Nom :"& nom2 &"<br>Prénom :"& prenom2 &"<br>adresse :"& adresse2 &"<br>cp :"& cp2 &"<br>ville :"& ville2 &"<br>tel :"& tel2 &"<br><br></font></td></tr></table><br><br>"
SQL3b="SELECT * FROM details WHERE Num = '"&numcommande&"' order by Ligne"
Set Rscom = conn.Execute(SQL3b)
if not Rscom.eof then
mySmartMail.Body = mySmartMail.Body + "<table border=1 bordercolor=black cellpadding=1 cellspacing=1 width=600><tr><td align=center bgcolor=#CCCCCC><font face=Arial size=1><b>Ref</b></font></td><td align=center width=60 bgcolor=#CCCCCC><font face=Arial size=1><b>Qte</b></font></td><td align=center width=80 bgcolor=#CCCCCC><font face=Arial size=1><b>Prix</b></font></td><td align=center width=100 bgcolor=#CCCCCC><font face=Arial size=1><b>Catégorie</b></font></td><td align=center width=100 bgcolor=#CCCCCC><font face=Arial size=1><b>ss Cat</b></font></td><td align=center width=60 bgcolor=#CCCCCC><font face=Arial size=1><b>Type</b></font></td></tr>"
while not Rscom.eof
if Rscom("Qte")<>"0" then
mySmartMail.Body = mySmartMail.Body + "<tr><td align=center ><font face=Arial size=2>"& Rscom("Reference") &"</font></td><td align=center ><font face=Arial size=2>"& Rscom("Qte") &"</font></td><td align=center ><font face=Arial size=2>"& Rscom("Prix") &"</font></td><td align=center ><font face=Arial size=2>"& replace(Rscom("Cat"),"'"," ") &"</font></td><td align=center ><font face=Arial size=2>"& replace(Rscom("SCat"),"'"," ") &"</font></td><td align=center ><font face=Arial size=2>"& replace(Rscom("Volume"),"'"," ") &"</font></td></tr>"
end if
Rscom.movenext
wend
else
mySmartMail.Body ="<table><tr><td align=center bgcolor=#CCCCCC>Pas de produits enregistrés</td></tr>"
end if
mySmartMail.Body = mySmartMail.Body + "</table>"
mySmartMail.Body = mySmartMail.Body + "<br><br><table border=1 bordercolor=black cellpadding=1 cellspacing=1 ><tr><td><font size=2 face=Arial>RESUME<br><br>Date :"& date() &"<br>Montant total HT:"& formatnumber((total),2) &"<br>Frais de Port HT :"& port &"<br>Remise HT:"& formatnumber((remise2),2) &"<br>TVA :"& formatnumber((totalttc - total),2) &"<br>Montant total TTC:"& formatnumber((totalttc),2) &"<br>Mode de Paiement : "& session("reg") &"</font></td></tr></table>"
' Send the message
' ****************
mySmartMail.SendMail
if err.number <> 0 then
response.write("Error n° " & err.number - vbobjecterror & " = " & err.description & "<br>")
else
Response.Write " E-mail administrateur envoyé avec succès <br>"
mySmartMail.Recipients.Clear
end if
' ACCUSE RECEPTION
' Mail Server
' ***********'
mySmartMail.Server = "localhost"
mySmartMail.ContentType = "text/plain"
' From'
' ****'
mySmartMail.SenderName = "truc.com"
mySmartMail.SenderAddress = "admin@truc.com"
' To'
' **'
mySmartMail.Recipients.Add email , nom
' Parameter'
' *********'
mySmartMail.Priority = 1
' Message'
' *******'
mySmartMail.Subject = "Confirmation de commande truc.com"
mySmartMail.Body = "Cher client," & _
"" & Chr(13) & Chr(10) & _
"truc.com vous remercie de votre confiance." & _
"" & Chr(13) & Chr(10) & _
"Votre commande sera traitée dans les plus brefs délais." & _
"" & Chr(13) & Chr(10) & _
"A très bientôt sur notre site." & Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10) & _
"L équipe de truc.com. " & Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10) & _
"Récapitulatif de votre commande:"& Chr(13) & Chr(10) & _
""
mySmartMail.Body = mySmartMail.Body + "Référence de la commande :" & numcommande & _
"" & Chr(13) & Chr(10 ) & _
"Référence de la commande interne :"& numinterne & Chr(13) & Chr(10) & _
"Date :"& date() & Chr(13) & Chr(10) & _
"Frais de port HT :"& port &" Euros" &Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10 ) & _
""
if paie="CR" then
mySmartMail.Body = mySmartMail.Body + "Montant Commande TTC :"& FormatNumber((totalttc)+(10*1.196),2) &" Euros" & Chr(13) & Chr(10) & _
"Mode de Paiement : "&session("reg") & Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10 ) & _
""
else
mySmartMail.Body = mySmartMail.Body + "Montant Commande TTC :"& formatnumber((totalttc),2) &" Euros" & Chr(13) & Chr(10) & _
"Mode de Paiement : "&session("reg") & Chr(13) & Chr(10) & _
"" & Chr(13) & Chr(10 ) & _
""
end if
' Send the message
' ****************
mySmartMail.SendMail
if err.number <> 0 then
response.write("Error n° " & err.number - vbobjecterror & " = " & err.description & "<br>")
else
Response.Write " E-mail Client envoyé avec succès"
end if
set mySmartMail = nothing
end if
%>
<%
if ValidEmail(email)= true then
Session("cartmodele2")=""
end if%> |
Partager