FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » phpmailer
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
phpmailer [message #171443] Mon, 03 January 2011 21:42 Go to next message
smerf is currently offline  smerf
Messages: 12
Registered: January 2011
Karma: 0
Junior Member
In what way could I get such structure in PHPMailer (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
Is there any good working project?

Bart
Re: phpmailer [message #171451 is a reply to message #171443] Tue, 04 January 2011 13:26 Go to previous messageGo to next message
Derek Turner is currently offline  Derek Turner
Messages: 48
Registered: October 2010
Karma: 0
Member
On Mon, 03 Jan 2011 22:42:17 +0100, smerf wrote:

> I noticed that http://swiftmailer.org/ has the same problem. Is there
> any good working project?

Have you looked at Zendmail?

Derek
Re: phpmailer [message #171453 is a reply to message #171451] Tue, 04 January 2011 18:04 Go to previous messageGo to next message
smerf is currently offline  smerf
Messages: 12
Registered: January 2011
Karma: 0
Junior Member
On 2011-01-04 14:26, Derek Turner wrote:
> On Mon, 03 Jan 2011 22:42:17 +0100, smerf wrote:
>
>> I noticed that http://swiftmailer.org/ has the same problem. Is there
>> any good working project?
>
> Have you looked at Zendmail?
>
> Derek

Zend_Mail has the same problem.
Re: phpmailer [message #171454 is a reply to message #171443] Tue, 04 January 2011 18:30 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 03-01-11 22:42, smerf wrote:
> In what way could I get such structure in PHPMailer
> (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
> Is there any good working project?
>
> Bart
>
>
>


<?php
require("class.phpmailer.php");

$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 = "me(at)example(dot)com";
$mail->FromName = "Me";
$mail->AddAddress("me(at)example(dot)com", "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";

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

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... ;-)


--
Luuk
Re: phpmailer [message #171456 is a reply to message #171454] Tue, 04 January 2011 20:19 Go to previous messageGo to next message
smerf is currently offline  smerf
Messages: 12
Registered: January 2011
Karma: 0
Junior Member
On 2011-01-04 19:30, Luuk wrote:
> On 03-01-11 22:42, smerf wrote:
>> In what way could I get such structure in PHPMailer
>> (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
>> Is there any good working project?
>>
>> Bart
>>
>>
>>
>
>
> <?php
> require("class.phpmailer.php");
>
> ....
>
> 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... ;-)
>
>


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 way.
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 [message #171457 is a reply to message #171443] Tue, 04 January 2011 21:39 Go to previous messageGo to next message
smerf is currently offline  smerf
Messages: 12
Registered: January 2011
Karma: 0
Junior Member
On 2011-01-03 22:42, smerf wrote:
> In what way could I get such structure in PHPMailer (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
> Is there any good working project?
>
> Bart
>
>
>

The problem is described here https://sourceforge.net/tracker/?func=detail&aid=1896836&group_id=2 6031&atid=385707
Where is solution on the net??

Pls help
Re: phpmailer [message #171459 is a reply to message #171457] Tue, 04 January 2011 21:54 Go to previous messageGo to next message
smerf is currently offline  smerf
Messages: 12
Registered: January 2011
Karma: 0
Junior Member
On 2011-01-04 22:39, smerf wrote:
> On 2011-01-03 22:42, smerf wrote:
>> In what way could I get such structure in PHPMailer (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
>> Is there any good working project?
>>
>> Bart
>>
>>
>>
>
> The problem is described here https://sourceforge.net/tracker/?func=detail&aid=1896836&group_id=2 6031&atid=385707
> Where is solution on the net??
>
> Pls help


Here http://mantis.phplist.com/print_bug_page.php?bug_id=15165
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 [message #171479 is a reply to message #171456] Wed, 05 January 2011 09:32 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 04-01-11 21:19, smerf wrote:
> On 2011-01-04 19:30, Luuk wrote:
>> On 03-01-11 22:42, smerf wrote:
>>> In what way could I get such structure in PHPMailer
>>> (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
>>> Is there any good working project?
>>>
>>> Bart
>>>
>>>
>>>
>>
>>
>> <?php
>> require("class.phpmailer.php");
>>
>> ....
>>
>> 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... ;-)
>>
>>
>
>
> 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 way.
> 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.
>
>
>

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
accordingly...

--
Luuk
Re: phpmailer [message #171558 is a reply to message #171459] Mon, 10 January 2011 05:40 Go to previous message
mlemos is currently offline  mlemos
Messages: 2
Registered: September 2010
Karma: 0
Junior Member
Hello,

on 01/04/2011 07:54 PM smerf said the following:
> On 2011-01-04 22:39, smerf wrote:
>> On 2011-01-03 22:42, smerf wrote:
>>> In what way could I get such structure in PHPMailer
>>> (http://sourceforge.net/projects/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 http://swiftmailer.org/ has the same problem.
>>> Is there any good working project?

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

http://www.phpclasses.org/mimemessage



--

Regards,
Manuel Lemos

JS Classes - Free ready to use OOP components written in JavaScript
http://www.jsclasses.org/

--- news://freenews.netfront.net/ - complaints: news(at)netfront(dot)net ---
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Discovering all sub-classes via introspection?
Next Topic: More advanced PHP books
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 04:46:47 GMT 2024

Total time taken to generate the page: 0.01747 seconds