Forums

ASP

This topic is locked

Help with jmail to CDONTS conversion

Posted 22 Apr 2007 21:17:28
1
has voted
22 Apr 2007 21:17:28 Micke Bergman posted:
Hi, I need help to convert jmail code to CDONTS because the server people refuse to install jmail...
Can someone please help me to convert this jmail code to CDONTS:

<pre id=code><font face=courier size=2 id=code>
&lt;% Set jmail = Server.CreateObject("jmail.Message"
jmail.From = " "
jmail.FromName = "Mr Clean"
jmail.AddRecipient " "
jmail.Subject = "Sign up for newsletter"
jmail.HTMLBody = "&lt;font face='arial' size='5'&gt;&lt;b&gt; Sign up - New members&lt;/b&gt;&lt;/font&gt;&lt;font face='arial' size='2'&gt;&lt;br&gt;&lt;br&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Company:&lt;/b&gt;&lt;/font&gt; " & request.form("company" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Address: &lt;/b&gt;&lt;/font&gt;" & request.form("address" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Zip code: &lt;/b&gt;&lt;/font&gt;" & request.form("zip" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;City: &lt;/b&gt;&lt;/font&gt;" & request.form("city" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Contact person: &lt;/b&gt;&lt;/font&gt;" & request.form("contactfullname" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Telephone: &lt;/b&gt;&lt;/font&gt;" & request.form("contacttele" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;E-mail: &lt;/b&gt;&lt;/font&gt;" & request.form("contactemail" & "&lt;br /&gt;" _
& "&lt;font color='#000099'&gt;&lt;b&gt;Message: &lt;/b&gt;&lt;/font&gt;" & request.form("therest" & "&lt;br /&gt;" _
& "&lt;/font&gt;"



if not jmail.Send("mail.hymans.se" ) then
Response.write "FEL &lt;pre&gt;" & msg.log & "&lt;/pre&gt;"
else
Response.write "Message sent succesfully!"
end if

set jmail=nothing
response.redirect "thanks.html" )
%&gt;
</font id=code></pre id=code>
Any kind of help is greatly appreciated!

/Micke

Replies

Replied 17 May 2007 19:37:19
17 May 2007 19:37:19 dave blohm replied:
here ya go...let me know if you have any questions

<pre id=code><font face=courier size=2 id=code>&lt;%
if request.form &lt;&gt; "" then
Set jmail = createobject("CDONTS.NewMail"
with jmail
.BodyFormat = 0
.MailFormat = 0
.To = ' ::::: YOUR "TO" ADDRESS GOES HERE ::::: '
.From = " &lt;Mr Clean&gt;"
.Subject = "Sign up for newsletter"
.Body = "&lt;font face='arial' size='5'&gt;&lt;b&gt; Sign up - New members&lt;/b&gt;&lt;/font&gt;&lt;font face='arial' size='2'&gt;&lt;br&gt;&lt;br&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Company:&lt;/b&gt;&lt;/font&gt; " & request.form("company" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Address: &lt;/b&gt;&lt;/font&gt;" & request.form("address" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Zip code: &lt;/b&gt;&lt;/font&gt;" & request.form("zip" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;City: &lt;/b&gt;&lt;/font&gt;" & request.form("city" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Contact person: &lt;/b&gt;&lt;/font&gt;" & request.form("contactfullname" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Telephone: &lt;/b&gt;&lt;/font&gt;" & request.form("contacttele" & "&lt;br /&gt;" _& "&lt;font color='#000099'&gt;&lt;b&gt;E-mail: &lt;/b&gt;&lt;/font&gt;" & request.form("contactemail" & "&lt;br /&gt;"
_& "&lt;font color='#000099'&gt;&lt;b&gt;Message: &lt;/b&gt;&lt;/font&gt;" & request.form("therest" & "&lt;br /&gt;" _& "&lt;/font&gt;"
end with
jmail.send
jmail = nothing
response.write "Message sent succesfully!"
response.redirect "thanks.html"
else %&gt;
&lt;form&gt;heres where i would put my mail form, but that's just me&lt;/form&gt;
&lt;% end if%&gt;</font id=code></pre id=code>

Hope this helps.

- Doc

Progress is made by the discontent.

Reply to this topic