472,145 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

sending mail with images

Hi,
I'm using ASP 3 and I send mail with CDONTS.NewMail or CDO.Message.
If my mail contains some html code with images like <img src="URL">, OE
blocks image's visualization.
If i want to avoid this, when i send my mail from OE i flag "send images
with message" option.
How can i realize this when i send the mail with ASP?

Thanks
Dec 7 '06 #1
5 3679
I'm looking AttachURL method.

objMail.AttachURL Source, ContentLocation

But it seems not to work if i put in Source a path like
http://www.google.it/intl/it_it/images/logo.gif
Dec 7 '06 #2
Hi,
view below (i have tested it successfuly ):
messageHTML = "<BODY><CENTER><IMG src=" + IMAGEFILE + " />"
messageHTML = .....

sendMailHtml("fr**@me.com" ,"to@you.com" , "TEST" , messageHTML)

Sub sendMailHtml(emetteur, destinataire, sujet, message)
Dim objMAIL
Dim cheminImage
Dim objShell

set objShell = CreateObject("WScript.Shell")
cheminImage = objShell.CurrentDirectory + "\" + IMAGEFILE

set objMAIL = CreateObject("CDO.Message")
objMAIL.From = emetteur
objMAIL.To = destinataire
objMAIL.Subject = sujet
objMAIL.HTMLBody = message

objMAIL.AddRelatedBodyPart cheminImage , IMAGEFILE ,
CDOCdoReferenceTypecdoRefTypeId

objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
"smtphost"
objMAIL.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMAIL.Configuration.Fields.Update
On Error Resume Next
objMAIL.Send

If Err.Number <0 Then

'Wscript.echo "Erreur : " + Cstr(Err.Number) + " ," +
Err.Description
On error goto 0

End if

End Sub

Dec 8 '06 #3
set objMAIL = CreateObject("CDO.Message")

Thanks, but it works only on IIS..
Is it possible to use CDONTS and use a web path like this
http://www.google.it/intl/it_it/images/logo.gif to attach an image?
Dec 10 '06 #4

"Giorgio" <da*@sa.itwrote in message
news:45***********************@reader2.news.tin.it ...
set objMAIL = CreateObject("CDO.Message")

Thanks, but it works only on IIS..
What do you want it to work 'on'?
Is it possible to use CDONTS and use a web path like this
http://www.google.it/intl/it_it/images/logo.gif to attach an image?
CDONTS is deprecated, why is using CDOSYS a problem?
Dec 10 '06 #5
What do you want it to work 'on'?
on a web site that supports asp 3

CDONTS is deprecated, why is using CDOSYS a problem?
i'm interested in that AttachURL method
objMail.AttachURL Source, ContentLocation
but it works only if "Source" is Server.MapPath ("filename")
and not working if "Source" is a link like http://www...
By the way, which way do you suggest using with CDOSYS?
Dec 10 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by prasanna | last post: by
2 posts views Thread by Nis Sarup | last post: by
6 posts views Thread by Eduardo Rosa | last post: by
14 posts views Thread by Bernie Yaeger | last post: by
2 posts views Thread by Aneesh Pulukkul[MCSD.Net] | last post: by
6 posts views Thread by ssankar | last post: by
1 post views Thread by runway27 | last post: by
reply views Thread by Saiars | last post: by

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.