Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 2nd, 2006, 06:12 AM
pftelecom pftelecom is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 5 pftelecom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 16 sec
Reputation Power: 0
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 "&nbsp;<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
%>

Reply With Quote
  #2  
Old March 2nd, 2006, 06:42 AM
degsy degsy is offline
Contributing User
ASP Free God 2nd Plane (6000 - 6499 posts)
 
Join Date: Aug 2005
Location: North East, UK
Posts: 6,191 degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 41 m 52 sec
Reputation Power: 121
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

Reply With Quote
  #3  
Old March 2nd, 2006, 06:48 AM
pftelecom pftelecom is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 5 pftelecom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 16 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old March 2nd, 2006, 07:01 AM
degsy degsy is offline
Contributing User
ASP Free God 2nd Plane (6000 - 6499 posts)
 
Join Date: Aug 2005
Location: North East, UK
Posts: 6,191 degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 41 m 52 sec
Reputation Power: 121
Just make the changes I pointed out

Reply With Quote
  #5  
Old March 2nd, 2006, 07:03 AM
pftelecom pftelecom is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 5 pftelecom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 16 sec
Reputation Power: 0
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

Reply With Quote
  #6  
Old March 3rd, 2006, 07:04 AM
degsy degsy is offline
Contributing User
ASP Free God 2nd Plane (6000 - 6499 posts)
 
Join Date: Aug 2005
Location: North East, UK
Posts: 6,191 degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level)degsy User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 19 h 41 m 52 sec
Reputation Power: 121
Post the code that you tried.

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Need help i need to reprogram this code for use with CDOSYS instead of Jmail.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT