Solved

send attached image

Posted on 2009-04-08
3
441 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

737 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