944,028 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4327
  • PHP RSS
Nov 27th, 2006
0

Image link in an email from php

Expand Post »
Hello all and thanks in advance, I am attempting to add an image in an email that is generated from php.
Here is the php code
php Syntax (Toggle Plain Text)
  1. $ttext = "
  2. Hello,
  3.  
  4. $_POST[name], whose email address is $_POST[email] thought you may be interested in this event.
  5.  
  6. $_POST[refurl]
  7. $_POST[name] Has left you a personal note.
  8. $_POST[note]
  9.  
  10. $_POST[name] sent this information from www.communitychapel.net.
  11.  
  12. <img>http://www.communitychapel.net/assets/Map.jpg</img>
  13.  
  14. We look forward to your visit!
  15.  
  16. ";
the email shows the html code fro the link,
thanks again
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fixyourdns is offline Offline
5 posts
since Nov 2006
Nov 28th, 2006
0

Re: Image link in an email from php

Hi,

<img>http://www.communitychapel.net/assets/Map.jpg</img>

You doesnt try like the above code for image tag during mail send.

Please try like this below..

<img src="www.communitychapel.net/assets/Map.jpg " ></img>

May its helpful for you..
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mahe4us is offline Offline
54 posts
since Sep 2006
Nov 30th, 2006
0

Re: Image link in an email from php

Thank you testing now
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fixyourdns is offline Offline
5 posts
since Nov 2006
Dec 1st, 2006
0

Re: Image link in an email from php

Testing failed tryed...
<img src="www.communitychapel.net/assets/Map.jpg " ></img>
<img src="www.communitychapel.net/assets/Map.jpg " >
PRINT
<img src='www.communitychapel.net/assets/Map.jpg'>
Maybe I need to attach the image, Thanks for the help
Reputation Points: 10
Solved Threads: 0
Newbie Poster
fixyourdns is offline Offline
5 posts
since Nov 2006
Dec 1st, 2006
0

Re: Image link in an email from php

Hi,

I think you are using the above code in message section of mail function. for example

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

I think you assign the image tags and other kind of information in the $message variable. Then you finally send mail to endusers. If you did like that then you will be in need of use some quotes format in $message variable. Here below I sent the sample code to send mail with picture. Please refer it...Also you use the table as you wish. otherwise you just enter the image tag in the quoted string like below.

//sample coe
<?
$message = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<body>
<table width="780" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="72">&nbsp;</td>
<td width="626" height="51"><img src="www.communitychapel.net/assets/Map.jpg " ><" width="235" height="51"></td>
<td width="74">&nbsp;</td>
</tr>
</table>
</body>
</html>';
?>
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
mahe4us is offline Offline
54 posts
since Sep 2006
Dec 1st, 2006
0

Re: Image link in an email from php

make sure the mail's Content-Type header is text/html:

i.e:

$headers = "Content-type:text/html";
mail($to, $subject, $message, $headers);
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
MattEvans is offline Offline
1,091 posts
since Jul 2006
Dec 2nd, 2006
0

Re: Image link in an email from php

Some email providers (optionally) block external images, so sending an external image by email may not work.
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC