Solved

send attached image

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now