Home »
Imported messages »
comp.lang.php »
phpmailer
Re: phpmailer [message #171454 is a reply to message #171443] |
Tue, 04 January 2011 18:30 |
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
|
|
|
Goto Forum:
Current Time: Fri Nov 22 23:04:17 GMT 2024
Total time taken to generate the page: 0.05109 seconds