Solved

send attached image

Posted on 2009-04-08
3
440 Views
Last Modified: 2013-12-12
I would like to send an attached image by mb_send_mail function. I have an image at a folder. How can I put an image into mb_send_mail?
$image='../images/party.jpg';
 
$mailform="From:" .mb_encode_mimeheader($subject) ."<".$sender_mail.">";
		mb_send_mail($EMAILS,$subject,$msg,$mailform);

Open in new window

0
Comment
Question by:portal123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 24096824
If you want to send mails with attachments use a PHP-Class which does the valid encoding like
http://phpmailer.sf.net
http://swiftmailer.sf.net
0
 
LVL 19

Accepted Solution

by:
NerdsOfTech earned 500 total points
ID: 24102795
MIME-Version: 1.0
Content-Type: multipart/mixed;
$attachments='';
$Headers     =<<<AKAM
From: $FromName <$FromEmail>
Reply-To: $FromEmail
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="$boundary1"
AKAM;
 
for($j=0;$j<count($ftype); $j++){
$attachments.=<<<ATTA
--$boundary1
Content-Type: $ftype[$j];
    name="$fname[$i]"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
    filename="$fname[$j]"
 
$attachment[$j]
 
ATTA;
}

Open in new window

0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question