picture in an email

liunx

Guest
I want to send a picture within an email. Somehow the pic doesn't shop up in the email. This is my code:

on error resume next
Set Mailer = Server.CreateObject("CDONTS.NewMail")

Onderwerp = "confirmation"
VerstuurNaar = "[email protected]"

email = request("strEmail")

if email = "" then
email = "[email protected]"
end if

Mailer.From = VerstuurNaar
Mailer.To = email
Mailer.Subject = Onderwerp
Mailer.bcc = "[email protected]"

%>
<font face="Verdana" size="2">
<%
Bericht = Bericht & "<img border=""0"" src=http://www.htmlforums.com/archive/index.php/""http://www.mysite.nl/images/topcopy.jpg"" width=""658"" height=""101"">;"
Bericht = "Dank u voor de bestelling die op mysite.nl heeft geplaatst" & vbcrlf
Bericht = Bericht & "Met deze mail wordt de bestelling bevestigd en verzoeken wij u vriendelijk" & vbcrlf
Bericht = Bericht & "het bedrag binnen 7 dagen na " & Request.form("Date") & " over te maken naar rekening" & vbcrlf & vbcrlf
Bericht = Bericht & "FACTUURGEGEVENS: " & vbcrlf & vbcrlf
Bericht = Bericht & "Bedrag: " & Request.form("intTotal") & vbcrlf
Bericht = Bericht & "Verzendkosten: " & Request.form("intShipping") & vbcrlf
Bericht = Bericht & "BTW: " & Request.form("intTax") & vbcrlf
Bericht = Bericht & "Voornaam: " & Request.form("strFirst") & vbcrlf
Bericht = Bericht & "Achternaam: " & Request.form("strLast") & vbcrlf
Bericht = Bericht & "Email: " & Request.form("strEmail") & vbcrlf
Bericht = Bericht & "Adres: " & Request.form("strAddress1") & vbcrlf
Bericht = Bericht & "Postcode: " & Request.form("strPostalCode") & vbcrlf
Bericht = Bericht & "Land: " & Request.form("strCountry") & vbcrlf
Bericht = Bericht & "Plaats: " & Request.form("strCity") & vbcrlf
Bericht = Bericht & "Telefoon: " & Request.form("strPhone") & vbcrlf

IF len(trim(Request.form("strShipFirst"))) > 0 THEN
Bericht = Bericht & "U heeft gekozen om de bestelling op het volgende adres te bezorden: " & vbcrlf & vbcrlf
Bericht = Bericht & "Voornaam: " & Request.form("strShipFirst") & vbcrlf
Bericht = Bericht & "Achternaam: " & Request.form("strShipLast") & vbcrlf
Bericht = Bericht & "Adres: " & Request.form("strShipAddress") & vbcrlf
Bericht = Bericht & "Postcode: " & Request.form("strShipPostalCode") & vbcrlf
Bericht = Bericht & "Plaats: " & Request.form("strShipCity") & vbcrlf
Bericht = Bericht & "Verzendmethode: " & Request.form("strShipMethod") & vbcrlf
END IF
%>
</font>
<%
Mailer.Body = Bericht
Mailer.Send
Set Mailer = nothinglook into CDO.SYS and sending HTML emails

<!-- m --><a class="postlink" href="http://www.w3schools.com/asp/asp_send_email.aspI">http://www.w3schools.com/asp/asp_send_email.aspI</a><!-- m --> just tried direct linking to your image and I got a page cannot be displayed error.

<!-- m --><a class="postlink" href="http://www.mysite.nl/images/topcopy.jpgThe">http://www.mysite.nl/images/topcopy.jpgThe</a><!-- m --> site is for a client, so i write <!-- w --><a class="postlink" href="http://www.mysite.com">www.mysite.com</a><!-- w -->, but that's not the real URL...Ok, i checked out the site about sending emails with ASP. So, there can't be something wrong with my script....

I am getting an email, but only with text, not with html (so without taht picture). I'll give you my script, maybe one of you can see my mistake..?

on error resume next
Set Mailer=CreateObject("CDO.Message")

Onderwerp = "confirmation"
VerstuurNaar = "[email protected]"

email = request("strEmail")

if email = "" then
email = "[email protected]"
end if

Mailer.From = VerstuurNaar
Mailer.To = email
Mailer.Subject = Onderwerp
Mailer.bcc = "[email protected]"

%>
<font face="Verdana" size="2">
<%
Bericht = Bericht & "<img border=""0"" src=http://www.htmlforums.com/archive/index.php/""http://www.mysite.com/images/topcopy.jpg"" width=""658"" height=""101"">;"
Bericht = "blahblah" & vbcrlf
Bericht = Bericht & "blahblahblieh" & vbcrlf
Bericht = Bericht & "blahblah " & Request.form("Date") & " blahblah" & vbcrlf & vbcrlf
Bericht = Bericht & "blahblah: " & vbcrlf & vbcrlf
Bericht = Bericht & "Bedrag: " & Request.form("intTotal") & vbcrlf
Bericht = Bericht & "Verzendkosten: " & Request.form("intShipping") & vbcrlf
Bericht = Bericht & "BTW: " & Request.form("intTax") & vbcrlf
Bericht = Bericht & "Voornaam: " & Request.form("strFirst") & vbcrlf
Bericht = Bericht & "Achternaam: " & Request.form("strLast") & vbcrlf
Bericht = Bericht & "Email: " & Request.form("strEmail") & vbcrlf
Bericht = Bericht & "Adres: " & Request.form("strAddress1") & vbcrlf
Bericht = Bericht & "Postcode: " & Request.form("strPostalCode") & vbcrlf
Bericht = Bericht & "Land: " & Request.form("strCountry") & vbcrlf
Bericht = Bericht & "Plaats: " & Request.form("strCity") & vbcrlf
Bericht = Bericht & "Telefoon: " & Request.form("strPhone") & vbcrlf

IF len(trim(Request.form("strShipFirst"))) > 0 THEN
Bericht = Bericht & "U heeft gekozen om de bestelling op het volgende adres te bezorden: " & vbcrlf & vbcrlf
Bericht = Bericht & "Voornaam: " & Request.form("strShipFirst") & vbcrlf
Bericht = Bericht & "Achternaam: " & Request.form("strShipLast") & vbcrlf
Bericht = Bericht & "Adres: " & Request.form("strShipAddress") & vbcrlf
Bericht = Bericht & "Postcode: " & Request.form("strShipPostalCode") & vbcrlf
Bericht = Bericht & "Plaats: " & Request.form("strShipCity") & vbcrlf
Bericht = Bericht & "Verzendmethode: " & Request.form("strShipMethod") & vbcrlf
END IF
%>
</font>
<%
Mailer.HTMLBody = Bericht
Mailer.Send
Set Mailer = nothingjust a quick question before we analyze this thing too far....

what kind of email client are you sending this to? Are you sure it supports html emails?I'm receiving my pop-emails in an outlook express client, so that should be able to handle html mails
 
Back
Top