472,789 Members | 1,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

creating and sending html email from asp server script

hello everyone:

i have a web site built using vbasic active server scripting running on
iis (it works on either iis 50 and 60, but is designed for iis 50)

i know how to create a plain text email by creating a text file, with
content following certain format, and saving that file into the correct
'..\mailroot\pickup' folder, and it is working fine
what i would like to know is how to create and send an email in html
format from my server script
i will appreciate anyone who can tell me where to find instructions on
how to do this
thank you much in advance
francois
Jul 22 '05 #1
4 2894
objMail.BodyFormat = 0
objMail.MailFormat = 0

http://www.4guysfromrolla.com/webtec...ail/faq6.shtml

HTH
"Francois Keyeux" <francois@REMOVE_CAPS_AND_INVALIDkeyeux.com.invali d> wrote in message news:Oc**************@TK2MSFTNGP14.phx.gbl...
hello everyone:

i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50)

i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..\mailroot\pickup' folder, and it is working fine
what i would like to know is how to create and send an email in html format from my server script
i will appreciate anyone who can tell me where to find instructions on how to do this
thank you much in advance
francois

Jul 22 '05 #2

ah yes i received your comment, thx u
yes i know of the CDONTS object, and i guess i need to correct my
original statement then: i need for the program to work under iis60 and
to the best of my knowledge CDONTS is not available under iis60 (i found
that frustrating actually to say the least)

i believe there is another server object under iis60, but my initial
quick look at the related docs showed that it was much more complicated
to create a email object - i could be wrong, thought - i was looking for
a quick simple way to do this, as it was possible with CDONTS

anyway, thx, but i need to repost my question with the requirement that
it must work under iis60 (that's the production server actually)

_____

From: Jake [mailto:sp******@alltel.net]
Posted At: Wednesday, January 26, 2005 21:32
Posted To: microsoft.public.inetserver.asp.general
Conversation: creating and sending html email from asp server script
Subject: Re: creating and sending html email from asp server script
objMail.BodyFormat = 0
objMail.MailFormat = 0

http://www.4guysfromrolla.com/webtec...ail/faq6.shtml

HTH

"Francois Keyeux" <francois@REMOVE_CAPS_AND_INVALIDkeyeux.com.invali d>
wrote in message news:Oc**************@TK2MSFTNGP14.phx.gbl...
hello everyone:

i have a web site built using vbasic active server scripting running on
iis (it works on either iis 50 and 60, but is designed for iis 50)

i know how to create a plain text email by creating a text file, with
content following certain format, and saving that file into the correct
'..\mailroot\pickup' folder, and it is working fine
what i would like to know is how to create and send an email in html
format from my server script
i will appreciate anyone who can tell me where to find instructions on
how to do this
thank you much in advance
francois

You can send email messages in HTML format with the SMTP service
(CDONTS) or MS Exchange. However beware that not all mail clients will
display it properly.
By default, CDONTS sends its emails in plain-text format. With
HTML-formatted email, however, we can do all sorts of neat stuff, such
as having different fonts, italics, colored text, embedded-images, etc.


<%

Dim objMail

Set objMail = Server.CreateObject("CDONTS.NewMail")

'//these are all the images that are in this message.

'//you must include them like this.

'//please note that you DO NOT have TO write the

'//entire file path in the <IMG> tag in the body after this.

'//make sure you see the image name after the path separated by a
comma

objMail.AttachURL "D:\images\myImage.gif", "myImage.gif"

objMail.AttachURL "D:\images\myImage2.gif", "myImage2.gif"

HTML = HTML & "<HTML>"

HTML = HTML & "<HEAD>"

HTML = HTML & "<TITLE>Send Mail with HTML</TITLE>"

HTML = HTML & "</HEAD>"

HTML = HTML & "<BODY bgcolor=""lightyellow"">"

HTML = HTML & "<TABLE cellpadding=""4"">"

HTML = HTML & "<TR><TH><FONT color=""darkblue"" SIZE=""4"">"

HTML = HTML & now() & " - "

HTML = HTML & "These are all great ASP Sites</FONT></TH></TR>"

HTML = HTML & "<TR><TD>"

HTML = HTML & "<A HREF=""http://www.4guysfromrolla.com"">"

HTML = HTML & "<IMG SRC=""myImage.gif""></A><BR><BR>"

HTML = HTML & "<A HREF=""http://www.4guysfromrolla.com"">"

HTML = HTML & "<IMG SRC=""myImage2.gif""></A><BR><BR>"

HTML = HTML & "</FONT></TD></TR></TABLE><BR><BR>"

HTML = HTML & "</BODY>"

HTML = HTML & "</HTML>"

objMail.From = "ro*@tconsult.com"

objMail.Subject = "Your daily HTML Mail"

'you need TO add these lines FOR the mail

'to be sent in HTML format

objMail.BodyFormat = 0

objMail.MailFormat = 0

objMail.To = "yo*@yourhouse.com

objMail.Body = HTML

objMail.Send

Response.write("Mail was Sent")

set objMail = nothing

%>


Jul 22 '05 #3
On Thu, 27 Jan 2005 08:37:57 -0500, "Francois Keyeux"
<francois@REMOVE_CAPS_AND_INVALIDkeyeux.com.invali d> wrote:

ah yes i received your comment, thx u
yes i know of the CDONTS object, and i guess i need to correct my
original statement then: i need for the program to work under iis60 and
to the best of my knowledge CDONTS is not available under iis60 (i found
that frustrating actually to say the least)

i believe there is another server object under iis60, but my initial
quick look at the related docs showed that it was much more complicated
to create a email object - i could be wrong, thought - i was looking for
a quick simple way to do this, as it was possible with CDONTS

anyway, thx, but i need to repost my question with the requirement that
it must work under iis60 (that's the production server actually)
You can send email messages in HTML format with the SMTP service
(CDONTS) or MS Exchange. However beware that not all mail clients will
display it properly.
By default, CDONTS sends its emails in plain-text format. With
HTML-formatted email, however, we can do all sorts of neat stuff, such
as having different fonts, italics, colored text, embedded-images, etc.


For many years now I've had great success and ease of use with the
JMail component.

www.dimac.net

--
Iain Norman | http://www.eliteforum.org
Jul 22 '05 #4
Not quiet sure how well it works but there is another component called
"CDOSYS" that microsoft wants everyone to move to. Is it any better
than CDONTS? I dont know.
Try this link, this script will work with any one of these: JMail,
CDONTS, CDOSYS, and ASPMail
http://www.brainjar.com/asp/formmail/

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Sven Templin | last post by:
Hello all, our configuration is as following described: - OS: Windows 2000 - Apache server 1.3 - Php 3.8 - MS outlook client 2000 _and_ no SMTP server available in the whole intranet.
4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
2
by: Marcelo | last post by:
Hi guys, I'm using the following code to send values from one page to another, but seems to me, that the event Page_Load in the receiving page never fires. Why? This is the code: Thanks ...
6
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
2
by: RAB | last post by:
I have a .aspx page with the following code: <% @Import Namespace="System.Web.Mail" %> <%@ page language="vb" debug="true" runat="server" %> <script runat="server"> Sub Click(sender as...
4
by: Rajendran | last post by:
I want to send mail through PHP using the MS Exchange server. My php.ini file looks like this (for the MAIL functions) ------- ; For Win32 only. SMTP = exchgserver.test.com smtp_port = 25 ;...
2
by: lstanikmas | last post by:
Hi, I'm validating a form with this ASP but receiving some blank email responses; does anyone see anything wrong with it?: function isFormVarExcluded(thisForm, strToCheck) { var strExcludeVars...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.