/    Sign up×
Community /Pin to ProfileBookmark

sending image in mail

Hi

I am writing a php script that send mail.
I use the php command call mail to send the mail.
I used html mail.
The mail content is

[CODE]
<img src=’/images/image.jpg’ />
[/CODE]

and indeed the tag appear in the mail.

However the image stayed in the server.

How can I make the command to send all object that are called from the html.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@TecBratNov 01.2011 — You are going to have to learn a little PHP to make this happen, but you'll need to search the message for any intance of "src" and pull the path out of it. Then you'll need to fread the file and base64 encode it, and chunk split it. Here's a link to a tutorial on attaching the images: http://www.litfuel.net/tutorials/mail2.htm
Copy linkTweet thisAlerts:
@awMinorNov 02.2011 — u need write right way to image. <img src='http://yousite.domane/images/image.jpg' /> that will work..
Copy linkTweet thisAlerts:
@TecBratNov 03.2011 — I think I was answering directly where aWminor answered the question that maybe should have been asked.

My suggestion would have led to the images being attached, but not displayed in the message. If the images will stay on the server, then absolute paths to them in the HTML of the message will make them show up.

Looks like someone else tackled the problem I thought you were having:

http://stackoverflow.com/questions/1606588/how-to-attach-and-show-image-in-mail-using-php (I did not test this.)
×

Success!

Help @programAngel spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...