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

Home » Imported messages » comp.lang.php » phpmailer
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: phpmailer [message #171454 is a reply to message #171443] Tue, 04 January 2011 18:30 Go to previous messageGo to previous message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma:
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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: Fri Sep 20 05:34:00 GMT 2024

Total time taken to generate the page: 0.04718 seconds