|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help i need to reprogram this code for use with CDOSYS instead of Jmail.
here is the code any one can re do it for use with CDOSYS ?
Thanks in advance /Patrik ------------------------ <%Response.Buffer = true%> <!--#include file="installningar.asp"--> <% Response.Buffer = true namn = Request.Form("namn") adress = Request.Form("adress") postnr1 = Request.Form("postnr1") postnr2 = Request.Form("postnr2") padress = Request.Form("postadress") tfn1 = Request.Form("tfn1") tfn2 = Request.Form("tfn2") epost = Request.Form("epost") ovrigt = Request.Form("ovrigt") info = Array(namn,adress,postnr1,postnr2,padress,tfn1,tfn 2,epost,ovrigt) info2 = "" For i = 0 to 8 info2 = info2 & info(i) IF Not i = 8 then info2 = info2 & "|" END IF Next For i = 0 to 7 IF NOT len(info(i)) <> 0 then Session("webshopfel") = "Du glömde att fylla i något fält" session("falt") = info2 Response.Redirect Request.ServerVariables("HTTP_REFERER") END IF Next IF len(info(2)) > 5 then Session("webshopfel") = "Felaktigt postnummer" Session("falt") = info2 Response.Redirect Request.ServerVariables("HTTP_REFERER") END IF Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &Server.MapPath("webshop.mdb") Session.Lcid = 1053 varde = Request.Cookies(""& Session.SessionID &"") hamta = Split(varde,"&") ReDim MyArray(4,Ubound(hamta)) for x = 0 to ubound(hamta) hamta2 = Split(hamta(x),"=") IF Len(hamta2(0)) > 0 AND len(hamta2(1)) > 0 then SQL = "SELECT * FROM produkter WHERE id =" & int(hamta2(0)) Set RecSet = Connect.Execute(SQL) MyArray(0,x) = hamta2(0) MyArray(1,x) = hamta2(1) MyArray(2,x) = RecSet("artnr") MyArray(3,x) = RecSet("namn") MyArray(4,x) = RecSet("pris") RecSet.Close Set RecSet = nothing END IF next Set jmail = Server.CreateObject("JMail.Message") jmail.AddRecipient ""& eposten &"", ""& eposten &"" jmail.From = "" & info(7) & "" jmail.Subject = "Beställning" jmail.appendHTML "<font face=verdana size=1>" For i = 0 To Ubound(myArray,2) IF Len(MyArray(0,i)) > 0 then jmail.appendHTML "<b>Art.nr: </b>" & MyArray(2,i) & "<br>" jmail.AppendHTML "<b>Produkt: </b>" & MyArray(3,i) & "<br>" jmail.AppendHTML "<b>Antal: </b>" & MyArray(1,i) & "<br>" jmail.AppendHTML "-------------------------------------------<br>" IF i = Ubound(myArray,2) then jmail.AppendHTML " <br>" END IF END IF Next jmail.appendHTML "<b>Namn: </b>" & info(0) & "<br>" jmail.appendHTML "<b>Adress: </b>" & info(1) & "<br>" jmail.appendHTML "<b>Postnr: </b>" & info(2) & info(3) & "<br>" jmail.appendHTML "<b>Postadress: </b>" & info(4) & "<br>" jmail.appendHTML "<b>Telefonnummer: </b>" & info(5) & "-" & info(6) & "<br>" jmail.appendHTML "<b>E-post: </b>" & info(7) & "<br>" jmail.appendHTML "<b>Övrigt: </b>" & info(8) & "<br>" jmail.appendHTML "<b>Skickat: </b>" & Now() & "<br>" jmail.appendHTML "</font>" jmail.Send(mailserver) For Each nyckel in Request.Cookies(Session.SessionID) Response.Cookies(Session.SessionID)(nyckel) = "" Next sida = Request.ServerVariables("HTTP_REFERER") & "&skickad=ja" Response.Redirect sida %> |
|
#2
|
|||
|
|||
|
If you just need to change the actual mail parts then here is an example of CDO mail
http://www.w3schools.com/asp/asp_send_email.asp Instead of AddRecipient use To Instead of appendHTML use HTMLBody e.g. myHTML = myHTML & "<h1>This is a message.</h1>" myHTML = myHTML & "<h2>This is another message.</h2>" myHTML = myHTML & "<p>this is more text</p>" myMail.HTMLBody = myHTML |
|
#3
|
|||
|
|||
|
Hi and thanks for the reply, i have wery dificault to fix this my own this mail stuff is for a order form from my shop to send what they have order and namn and adress.
So is it only to change the mail part of it so it can send it ? Br Patrik |
|
#4
|
|||
|
|||
|
Just make the changes I pointed out
|
|
#5
|
|||
|
|||
|
Just tested it and it diden't rwork the page say the page couldn't be weiwed and something like that.
Can you fix the change in the code i have pasted and you maby could send it up here again ? it would be wery wery helpful ![]() Thanks in advance / Patrik |
|
#6
|
|||
|
|||
|
Post the code that you tried.
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Need help i need to reprogram this code for use with CDOSYS instead of Jmail. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|