Html mail with images

0
August 17, 2011

I try do send to my customers via e-mail some details about my hosting service. Everytime customers want to know the price of services, I send to each e-mail, you can check in

http://pre.gloradin.com/ho sting.php

"informações".

I have some images that not appear in e-mail, like you see in image, I try with some paths but the images not appear.

The image are certo_pequeno.jpg and are located in

http://pre.gloradin.com/im agem/certo _pequeno.j pg

.

<?
$to = $email;   $nome = $POST['nome'];  $message = '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2900.3429" name=GENERATOR></HEAD>
<BODY>
<P><IMG alt="" hspace=0 src="http://pre.gloradin.com/imagem/logopretopequeno.jpg" 
align=baseline border=0></P>
<P><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: \"Times New Roman\"; mso-fareast-font-family: \"Times New Roman\"; mso-ansi-language: PT; mso-fareast-language: PT; mso-bidi-language: AR-SA"><FONT 
face=Verdana color=#0000ff size=5>Hosting e Domínios</FONT></SPAN></P><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: \"Times New Roman\"; mso-fareast-font-family: \"Times New Roman\"; mso-ansi-language: PT; mso-fareast-language: PT; mso-bidi-language: AR-SA">
<P><BR><FONT face=Verdana color=#0000ff size=4><U>Hosting</U></FONT></P></SPAN>
<P>
<TABLE style="WIDTH: 493px; HEIGHT: 468px" cellSpacing=0 cellPadding=0 width=493 
border=0>
  <TBODY>
  <TR>
    <TD><FONT face=Verdana color=#c0c0c0 size=4>PLANOS / 
    CARACTERÍSTICAS</FONT></TD>
    <TD><FONT face=Verdana> <FONT color=#ff0000 
size=4>b1</FONT></FONT></TD>
    <TD><FONT face=Verdana color=#ff0000 size=4> b2</FONT></TD>
    <TD><FONT face=Verdana color=#ff0000 size=4> b3</FONT></TD>
    <TD><FONT face=Verdana color=#ff0000 size=4> b4</FONT></TD></TR>
  <TR>
    <TD><STRONG><FONT face=Verdana color=#0000ff>Características 
      Tecnicas<BR></FONT></STRONG></TD>
    <TD><FONT face=Verdana></FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana> <FONT size=2><U>espaço em 
      disco</U></FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>1500MB<FONT color=#ffffff>...</FONT> 
    </FONT></TD>
    <TD><FONT face=Verdana size=2>2000MB<FONT 
    color=#ffffff>...</FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>3000MB<FONT 
    color=#ffffff>...</FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>6000MB<FONT 
    color=#ffffff>...</FONT></FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>transferencia mensal</U></FONT></TD>
    <TD><FONT face=Verdana><FONT size=2>1000MB<FONT 
      color=#ffffff>...</FONT></FONT></FONT></TD>
    <TD><FONT face=Verdana><FONT size=2>1500MB<FONT 
      color=#ffffff>...</FONT></FONT></FONT></TD>
    <TD><FONT face=Verdana><FONT size=2>3000MB<FONT 
      color=#ffffff>...</FONT></FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>5000MB<FONT 
    color=#ffffff>...</FONT></FONT></TD></TR>
  <TR>
    <TD><STRONG><FONT face=Verdana color=#0000ff>Serviço de 
      E-mail<BR></FONT></STRONG></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana> <FONT size=2><U>caixas de 
      correio</U></FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>3</FONT></TD>
    <TD><FONT face=Verdana size=2> 10</FONT></TD>
    <TD><FONT face=Verdana size=2>25</FONT></TD>
    <TD><FONT face=Verdana size=2>50</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>webmail</U></FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline border=0>   
      </FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
      border=0>    </FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>configuração outlook</U></FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>auto resposta</U></FONT></TD>
    <TD><FONT face=Verdana></FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD></TR>
  <TR>
    <TD><STRONG><FONT face=Verdana color=#0000ff>Outras 
      Caracteristicas<BR></FONT></STRONG></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana> <FONT size=2><U>php5</U></FONT></FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>mysql</U></FONT></TD>
    <TD><FONT face=Verdana size=2> </FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD>
    <TD>
      <P align=left><FONT face=Verdana size=2><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline 
    border=0></FONT></P></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>Imagemagick</U></FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD>
      <P align=left><FONT face=Verdana><IMG alt="" hspace=0 
      src="http://pre.gloradin.com/imagem/certopequeno.jpg" align=baseline border=0>  
      </FONT></P></TD></TR>
  <TR>
    <TD><STRONG><FONT face=Verdana color=#0000ff>Preços<BR></FONT></STRONG></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD>
    <TD><FONT face=Verdana> </FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana> <FONT size=2><U>um ano</U></FONT></FONT></TD>
    <TD><FONT face=Verdana size=2>72¬</FONT></TD>
    <TD><FONT face=Verdana size=2>96¬</FONT></TD>
    <TD><FONT face=Verdana size=2>132¬</FONT></TD>
    <TD><FONT face=Verdana size=2>300¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>dois anos</U></FONT></TD>
    <TD><FONT face=Verdana size=2>144¬</FONT></TD>
    <TD><FONT face=Verdana size=2>192¬</FONT></TD>
    <TD><FONT face=Verdana size=2>264¬</FONT></TD>
    <TD><FONT face=Verdana size=2>600¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>três anos</U></FONT></TD>
    <TD><FONT face=Verdana size=2>201¬</FONT></TD>
    <TD><FONT face=Verdana size=2>267¬</FONT></TD>
    <TD><FONT face=Verdana size=2>367¬</FONT></TD>
    <TD><FONT face=Verdana size=2>870¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>quatro anos</U></FONT></TD>
    <TD><FONT face=Verdana size=2>253¬</FONT></TD>
    <TD><FONT face=Verdana size=2>336¬</FONT></TD>
    <TD><FONT face=Verdana size=2>462¬</FONT></TD>
    <TD><FONT face=Verdana size=2>1083¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>cinco anos</U></FONT></TD>
    <TD><FONT face=Verdana size=2>300¬</FONT></TD>
    <TD><FONT face=Verdana size=2>398¬</FONT></TD>
    <TD><FONT face=Verdana size=2>548¬</FONT></TD>
    <TD><FONT face=Verdana size=2>1274¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2> <U>mensal (min 1 ano)</U></FONT></TD>
    <TD><FONT face=Verdana size=2>6¬</FONT></TD>
    <TD>
      <P><FONT face=Verdana size=2>8¬</FONT></P></TD>
    <TD><FONT face=Verdana size=2>11¬</FONT></TD>
    <TD><FONT face=Verdana size=2>25¬</FONT></TD></TR></TBODY></TABLE>
<HR>
<P></P>
<P><FONT face=Verdana color=#0000ff size=4><U>Domínios</U></FONT></P>
<P>
<TABLE style="WIDTH: 193px; HEIGHT: 180px" cellSpacing=0 cellPadding=0 width=193 
border=0>
  <TBODY>
  <TR>
    <TD><FONT face=Verdana><FONT color=#c0c0c0 size=4>PREÇOS / 
      DOMÍNIOS</FONT></FONT></TD>
    <TD><FONT face=Verdana color=#0000ff size=4> <FONT 
      color=#ff0000>anuidade </FONT></FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.com</U></FONT></TD>
    <TD><FONT face=Verdana size=2>19¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.pt</U></FONT></TD>
    <TD><FONT face=Verdana size=2>38¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.net</U></FONT></TD>
    <TD><FONT face=Verdana size=2>19¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.org</U></FONT></TD>
    <TD><FONT face=Verdana size=2>23¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.com.pt</U></FONT></TD>
    <TD><FONT face=Verdana size=2>35¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.info</U></FONT></TD>
    <TD><FONT face=Verdana size=2>15¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.tv</U></FONT></TD>
    <TD><FONT face=Verdana size=2>35¬</FONT></TD></TR>
  <TR>
    <TD><FONT face=Verdana size=2><U>.mobi</U></FONT></TD>
    <TD><FONT face=Verdana size=2>15¬</FONT></TD></TR></TBODY></TABLE></P>
<P> </P>
<TABLE style="WIDTH: 493px; HEIGHT: 48px" cellSpacing=0 cellPadding=0 width=493 
border=0>
  <TBODY>
  <TR>
    <TD>
      <P align=justify><A class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT 
      face=Verdana size=2><U>Os preços já incluem gestão e 
      redireccionamento.</U></FONT></A><BR><BR><A class=MsoNormal 
      style="MARGIN: 0cm 0cm 0pt"><FONT face=Verdana size=2><U>1ª Anuidade 
      gratuita dos domínios .com / .org / .net. / .info / .mobi, na compra de 
      Hosting b2, b3 e b4.</U></FONT></A><BR><BR><A class=MsoNormal 
      style="MARGIN: 0cm 0cm 0pt"><FONT face=Verdana size=2><U>Na compra de 
      Hosting de 4 ou 5 anos, oferta do domínio .com / .org / .net pelo tempo 
      contratado no hosting.</U></FONT></A></P></TD></TR></TBODY></TABLE>
<P>
<P> </P>
<P>
<HR>
<P></P>
<P></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Trebuchet MS" 
color=#ff8040 size=5><STRONG><U>Veja o que podemos fazer por 
si</U></STRONG></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face="Trebuchet MS" 
color=#0000ff size=2><A href="http://pre.gloradin.com/websites.php">websites</A> 
- <A href="http://pre.gloradin.com/marketing.php">marketing 
online</A></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">
<HR>
<P></P>
<P> </P>
<P><FONT face=Verdana size=4><U>Obrigado pela sua visita</U></FONT></P>
<P><U><FONT face=Verdana size=4></FONT></U> </P>
<P><U><FONT face=Verdana size=4></FONT></U> </P>
<P> </P></BODY></HTML>
';
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
    //$headers .= 'To: $nome <$mail>' . "\r\n";
    $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";

    mail($to, $subject, $message, $headers);        




 } ?></code></pre>
Attachments

Comments See all(0)

Add comment
0
August 17, 2011

The code are well writted, the problem is my firewall, I try without them and the arrows appear.

0
August 17, 2011

Nothing seems wrong with the HTML code, so I am going to assume somehow the HTML is being distorted when sending...

Try sending via PHP mailer instead of mail().

http://sourceforge.net/pro jects/phpm ailer

Below is the PHP code to use it. Place class.phpmailer.php into your php includes directory.

Replace text in << >> with your server information:

http://www.emailaddressman ager.com/t ips/mail-s ettings.ht ml

<?php
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host     = "<<smtpserver>>:<<stmpport>>"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "<<uname>>"; // SMTP username
$mail->Password = "<<pword>>"; // SMTP password
$mail->From = "<<email address from>>";
$mail->FromName = "<<email name from>>";
$mail->AddAddress("<<email address to>>"); 
$mail->AddReplyTo("<<email address from>>","<<email name from>>");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject  =  "Subject";
$mail->Body     =  "Body text";
$mail->AltBody  =  $mail->Body;
$mail->Send();
?>

Related Questions

Why won't images show in Apple Mail done with absolute links in html format?

I have created an Apple Mail signature using Dreamweaver 8 that includes images. &#160;Images have absolute links. Preview exactly right in Safari and Firefox. &#160;However, when saved as the appropr Read More

Views

9

Votes

0

Answers

4

August 17, 2011

Function Mail() with encoded images

I need to send HTML message via mail() with background image encoded in the mail body. How can I do that? Please note, that the mail is in Windows-1250 codepage. Relevant part of code: $link = mysql_c Read More

Views

13

Votes

0

Answers

10

August 17, 2011

Creating HTML E-mails

I have created an HTML email in Visual Studio. &#160;When I view the file in IE and choose File | Send | Page By E-mail the email formats correctly in Office 2007, except when I send it it seems to em Read More

Views

13

Votes

0

Answers

9

August 17, 2011

Mime email working on Linux but not windows

I have some code that is working flawlessly on a linux box... &#160; but not on my windows server... I know what some might say.. leave it on the linux box... &#160;But I cant ... It has to run on Win Read More

Views

15

Votes

0

Answers

6

August 17, 2011

How do I attach background image to the mail?

I want to attach background image to my mail. I am using phpmailer classes to send the mails. I can send mails with headers + image attachment &#160;... but not the image background attached mail ... Read More

Views

64

Votes

0

Answers

4

August 16, 2011

PHP and HTML email

Hi All, I have 2 questions, 2 request concerning PHP - mail function and HTML emails Questions: A. Is it possible to send an HTML email using PHP [ mail &#160;function ] that will be viewable using an Read More

Views

10

Votes

0

Answers

4

August 16, 2011

PHP html inline image mailer issue

I can&#39;t figure this out. I have the php code, it runs, sends the email, however, the second image doesn&#39;t attach, and does not show up in the attachments on the email. &lt;?php ############### Read More

Views

16

Votes

0

Answers

4

August 16, 2011

Image not repeated as background in outlook but visible in html page

I have created a flyer which is coming as email. The html is coming in the body of email. All images are hosted on server. There is a &lt;td&gt; in which I have added an image(width is 1pixel) as back Read More

Views

10

Votes

0

Answers

2

August 15, 2011

php and html code with hidden form

i have some code that displays ldap info of users it works and looks great in &quot;firefox&quot; But i need it to looks great in &quot;IE&quot; I have upload 2 image on from IE and other from firefox Read More

Views

18

Votes

0

Answers

6

August 16, 2011

Code to send an HTML Email in Lotus Notes

I have some VB code to send an email in Lotus Notes, which is essentially: &#160; Dim doc As Domino.NotesDocument &#160; Set doc = db.CreateDocument &#160; Call doc.AppendItemValue(&quot;From&quot; , Read More

Views

22

Votes

0

Answers

7

August 15, 2011

Size questions with outlook public folders and search

Hi, We are looking at using outlook public folders as a solution for allowing multiple users search and acces all &quot;business&quot; related emails. The idea is that all business related emails will Read More

Views

14

Votes

0

Answers

1

August 16, 2011

PHP issue with checkoutfunction page

Hello, I seem to have an error somewhere in our checkoutfunctions.php file that is causing it to error after a customer clicks to submit an order. After clicking submit, the payment gateway is success Read More

Views

44

Votes

0

Answers

2

August 17, 2011

PHP Configuration assistance for sending html emails

Hello Experts, I have created a test form with PHP so as soon as the customer clicks submit 2 emails will be generated: Email 1 : Email to me with the information the customer has entered. Email 2: Em Read More

Views

26

Votes

0

Answers

5

August 17, 2011

Problem when sending CDO based mail

Hi all hope U can help me with this one... When sending an email from webform I only get the word &quot;text&quot; as body... I changed the code from CDONTS to CDO (win2003 os now) and that is when th Read More

Views

14

Votes

0

Answers

6

August 17, 2011

formail validate fields

Hi I&#39;m using a the nms formail to process a form. &#160;the form is actually an online menu order that is a simplified shopping cart with out the checkout and extra fields. &#160;My question is ca Read More

Views

95

Votes

0

Answers

5

August 16, 2011

Conflicting javascripts?

Hi experts, I have an image display JavaScript that is functioning but has a minor issue. The script when working correctly should display thumbnails of images. on rollOver the script should call a la Read More

Views

0

Votes

0

Answers

17

August 16, 2011

unable to sent large data by ASP Script

Hi &#160; we are using below given script to send mail with large data,on win 2003 server.but getting error CDO.Message.1 error &#39;80040212&#39; The transport lost its connection to the server. /mai Read More

Views

21

Votes

0

Answers

9

August 16, 2011

Problem with online customer form

Hi there, I have a problem with the code in a fairly basic form which I have adapted so customers can &quot;tell a friend&quot; about courses we are running. I get this when I press submit on the form Read More

Views

29

Votes

0

Answers

3

August 16, 2011

Can I get a multi line input box to display as bullet points in return email?

HI guys I have a form located at http://www.blueprintcateri ng.com.au/ OnlineCate ringReques tTest.php that has an input box for &quot;FOOD REQUIRED&quot; Read More

Views

29

Votes

0

Answers

7

August 16, 2011

foreach() is more than required Used in a Form

Hello all. I have a piece of code where it enables me to upload images where this works well for the exception that even if no images/files are upload the foreach() is stepped through. I&#39;m not goo Read More

Views

26

Votes

0

Answers

9

August 16, 2011