Jump to content

HTML in Jmail


Johnmitchell

Recommended Posts

hi there :)i have written a feedback type form and i need it to send an email to my marketing crew but i need it in a certain format. at the moment it just lists all of the requested content in a paragraph.html form code:

<form onsubmit="return testdataprot()" name="theform" id="theform" action="jmailformatting.asp" method="post"><table border="0">	<tr><td colspan="2"><p>Please type your enquiry here:</p></td></tr>	<tr><td colspan="2"><br /><textarea cols="40" rows="6" name="Enquiry" ></textarea></td></tr>	<tr><td colspan="2"><p>To help our advisers understand more about your needs relating to your enquiry please complete the following sections and let us know if you prefer to be contacted by email or telephone.</p></td></tr>	<tr><td><p>Please reply to my enquiry by:</p></td>		<td><input type="radio" name="contact" value="Email">Email</input>			<input type="radio" name="contact" value="Phone">Phone</input></td></tr>	<tr><td><h3>Contact Details</h3></td></tr>	<tr><td><p>First name:</p></td><td><input type="text" name="firstname" /></td></tr>	<tr><td><p>Last name:</p></td><td><input type="text" name="lastname" /></td></tr>		<td><input type="submit" name="Submit" value="Submit enquiry" /></td>		<td><input type="reset" value="Cancel enquiry" /></td>	</tr></table><p>Thank you for your enquiry. You will be re-directed to our home page after this form has been successfully sent.</p></form>

#first off i know it's in tables and trust me im not happy with it but it was just a quick knock up to get them sorted for the time being.ASP code:

<% if request.form("Submit") = "Submit enquiry" then 	set message = Server.CreateOBject("JMail.Message")	message.Logging = true	message.silent = true	message.From = "mycompany@email.co.uk"	message.FromName = "Test TEst TEST"	message.addrecipient "my.email@company.co.uk", "John Mitchell"	message.Subject = "test this jmail formatting"	for i = 1 to Request.Form.Count 		strBody = strBody & Request.form.Key(i) & " = " & Request.form(i) & vbCrLf	next 	Message.Body = strBody		if not message.Send( "from our server ip" ) then		Response.write("<p>Error sending enquiry.</p>")		Response.write("<p>Please email the company to inform us of this error.</p>")		Response.write("<p>" & message.log & "</p>")	else		response.redirect("/e_advice_redirect.asp")	end ifelse %>

an example of the layout of email: I feel desperate and I don't know what else to do to find a job... contact = Phone firstname = Joe lastname = blogsthe way i want to lay it out:I feel desperate and I don't know what else to do to find a job... contact = Phone firstname = Joe lastname = blogsnote: i have deleted company sensitive information such as the if not message.send statement.please any help will be greatly appreciated!

Link to comment
Share on other sites

thanks for replying :) no one else was!i can get jmail to send the email, but i want to format the objects in html. at the moment, it's spitting out the objects in one big paragraph, i want to split them up to make them more readable to the people who will be reading the enquiry.that make sense? :)

Link to comment
Share on other sites

The first result of this Google search returns a page which indicates that you need to set the HTMLBody property rather than the Body property when you are attempting to send a message in HTML in Jmail.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...