Print Page | Close Window

JMail

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1007
Printed Date: 28 March 2026 at 11:05pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: JMail
Posted By: Scotty32
Subject: JMail
Date Posted: 14 March 2003 at 8:25am

ok, i just tryed to post this but it said i didnt have enuf permissions

ok attempt 2:

ok ill keep it simple then

the code below works, but it only shows the LAST "jmail.body" line:

 

<%
 Dim Recipient, email, body

 Recipient = "my email"
 email = "senders email
"

Set JMail = Server.CreateObject("JMail.SMTPMail")

' Below you should enter your own SMTP-server
JMail.ServerAddress = "smtp server"

JMail.Sender = email
JMail.Subject = "Feedback from " & page & " (my site
)"

JMail.AddRecipient Recipient

For Each Field in Request.Form

Body = "<B>" & Field & "</B> - " & Request.Form(Field) & "<br>"

Next

JMail.Body = body & "temp"

JMAIL.ContentType = "text/html"

JMail.Priority = 3

JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Logging = True
JMail.Execute

JMail.Close
Set JMail = nothing
%>

basically all i need to get working is the damm JMail.body part, as it only shows the last one eg:

jmail.body = "line 1"
jmail.body = "line 2"

only line 2 shows up

i hope you understand wot am askin, pppplllleeezzzz help




Replies:
Posted By: michael
Date Posted: 14 March 2003 at 8:56am
YOu are looping through the Request.Form and Body gets overwritten everytime so the line should be:

For Each Field in Request.Form

Body = Body & "<B>" & Field & "</B> - " & Request.Form(Field) & "<br>"

Next

 



Posted By: Scotty32
Date Posted: 14 March 2003 at 9:08am

oh

umm that makes sence now,
cant believe i didnt think of it

well guess cose am a "Newbie"

well thats for that




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net