473,886 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\pi ckup' 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 2979
objMail.BodyFor mat = 0
objMail.MailFor mat = 0

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

HTH
"Francois Keyeux" <francois@REMOV E_CAPS_AND_INVA LIDkeyeux.com.i nvalid> wrote in message news:Oc******** ******@TK2MSFTN GP14.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\pi ckup' 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.publi c.inetserver.as p.general
Conversation: creating and sending html email from asp server script
Subject: Re: creating and sending html email from asp server script
objMail.BodyFor mat = 0
objMail.MailFor mat = 0

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

HTH

"Francois Keyeux" <francois@REMOV E_CAPS_AND_INVA LIDkeyeux.com.i nvalid>
wrote in message news:Oc******** ******@TK2MSFTN GP14.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\pi ckup' 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.CreateOb ject("CDONTS.Ne wMail")

'//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.AttachU RL "D:\images\myIm age.gif", "myImage.gi f"

objMail.AttachU RL "D:\images\myIm age2.gif", "myImage2.g if"

HTML = HTML & "<HTML>"

HTML = HTML & "<HEAD>"

HTML = HTML & "<TITLE>Sen d Mail with HTML</TITLE>"

HTML = HTML & "</HEAD>"

HTML = HTML & "<BODY bgcolor=""light yellow"">"

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

HTML = HTML & "<TR><TH><F ONT color=""darkblu e"" 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.4guysfromro lla.com"">"

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

HTML = HTML & "<A HREF=""http://www.4guysfromro lla.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.c om"

objMail.Subject = "Your daily HTML Mail"

'you need TO add these lines FOR the mail

'to be sent in HTML format

objMail.BodyFor mat = 0

objMail.MailFor mat = 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@REMOV E_CAPS_AND_INVA LIDkeyeux.com.i nvalid> 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
4326
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
3036
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: /mypage.asp?value1=1&amp;value2=4&amp; ... which of course means nothing to asp.
2
9250
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 - I see hebrew, it is just sending by myself using *.aspx scripts). In web.config I have the following : <configuration> <system.web>
2
1648
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
2428
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
3
7737
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 value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP message. Eg/ can't sign/encrypt it etc. Thanks,
2
1888
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 Object, e as EventArgs) 'Create an instance of the MailMessage class
4
29125
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 ; For Win32 only. sendmail_from = thegoodboy@test.com
2
3769
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 = thisForm.elements.value; var arrExcludeVars = strExcludeVars.split(","); for (var j=0; j<arrExcludeVars.length; j++) { if (arrExcludeVars == strToCheck) return true;
0
9957
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9799
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10770
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10430
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7988
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4236
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.