Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
In what way could I get such structure in PHPMailer
( /):

- multipart/mixed
-- multipart/alternative
--- text/plain
--- multipart/related
---- text/html
---- image/jpeg (embedded image)
-- image/jpeg (standalone attachment)

General I have a problem when attach embedded image used in html and attach
another image as standalone attachment.
PHPMailer generates whole email as multipart/related instead of multipart/mixed
as structure above.

I noticed that has the same problem.
Is there any good working project?


Re: phpmailer

On Mon, 03 Jan 2011 22:42:17 +0100, smerf wrote:

Quoted text here. Click to load it

Have you looked at Zendmail?


Re: phpmailer

On 2011-01-04 14:26, Derek Turner wrote:
Quoted text here. Click to load it

Zend_Mail has the same problem.

Re: phpmailer

On 03-01-11 22:42, smerf wrote:
Quoted text here. Click to load it


$mail = new PHPMailer();

$mail->IsSMTP();                                      // set mailer to
use SMTP
$mail->Host = "localhost";  // specify main and backup server
$mail->SMTPAuth = false;     // turn on SMTP authentication
//$mail->Username = "jswan";  // SMTP username
//$mail->Password = "secret"; // SMTP password

$mail->From = "";
$mail->FromName = "Me";
$mail->AddAddress("", "Me");

$mail->WordWrap = 50;                                 // set word wrap
to 50 characters
$mail->AddAttachment("test.php");    // optional name
$mail->IsHTML(true);                                  // set email
format to HTML

$mail->Subject = "Here is the subject";
$mail->Body    = "This is the HTML message body <b>in bold!</b>";
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

   echo "Message could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;

echo "Message has been sent";

Oh, BTW, this is a copy of the example i found in  the file README,
after installing PHPMailer_v5.1.tar.gz from the website... ;-)


Re: phpmailer

On 2011-01-04 19:30, Luuk wrote:
Quoted text here. Click to load it

You didn't understand me. I wrote about 2 attachments in one email (first is
used in html body, second not).
Your code isn't this situation.

I have the same version of PHPMailer.
Look to ./examples/test_smtp_advanced.php and please send test email.

You will see this unread email in your mail client (ex. Thunderbird) in wrong
There is no clip icon in a row. Only if you open email the clip icon appears.
It's due to wrong source code of message. The correct structure should be as I
wrote at the beginning.

Re: phpmailer

On 04-01-11 21:19, smerf wrote:
Quoted text here. Click to load it

I do see what you mean, i also dont see the clip icon in thunderbird.

When i had a look at the PHP-code, i think the problem is with the
function 'InlineImageExists'.

In this mail there are two attachments, one is 'inline', the other is
not. Because an 'inline' attachment exists, the mail gets send using
'mulipart/related' as content-type.

With the attachment that is no inline, it should be 'mulipart/mixed', if
i understand this correct.

Best way to change this would be to add a parameter to the
AddAttachment() function, which indicates wheter this is an
inline-attachment or not, and change the function InlineImageExists


Re: phpmailer

On 2011-01-03 22:42, smerf wrote:
Quoted text here. Click to load it

The problem is described here
Where is solution on the net??

Pls help

Re: phpmailer

On 2011-01-04 22:39, smerf wrote:
Quoted text here. Click to load it

with notice about previous link
"I've checked over the PHPMailer bug database, sounds a lot like their bug
number 1896836 "Can't see attachments". This is marked as closed but I
can't see why as there is no acknowledgement that the problem is patched."

Re: phpmailer


on 01/04/2011 07:54 PM smerf said the following:
Quoted text here. Click to load it

You may want to try the MIME message class. The main example script
sends messages just like that without problems:


Manuel Lemos

JS Classes - Free ready to use OOP components written in JavaScript /

Site Timeline