Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,171,465 members, 7,881,635 topics. Date: Saturday, 06 July 2024 at 04:36 AM

Phpmailer Not Working - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Phpmailer Not Working (2666 Views)

Do You Know That Comment Form Is Not Working On Operamini : Fix It Now / Why Is Html Form Not Working On Website? / Google Adsense Is Not Working In Africa (2) (3) (4)

(1) (Reply) (Go Down)

Phpmailer Not Working by Easyphp: 5:26pm On Jun 23, 2010
Hello Landers!

I do use smtp to send mail on my site, at this point i wanted send mail with images (logo) but my smtp sent mail as plan text and not HTML. I try to alter the header with Content-Type = text/HTML and MIME VERSION = 1.0 in order to send mail with images but nothing work. Now I've turn to PHPMailer thinking that will make it easier (yes the mail is sent) but the image or logo is not showing instead it display an image icon. secondly the body contain a link (it change the color and underline it) but the link is not working on click. here is the code

require("class.phpmailer.php"wink;
require("class.smtp.php"wink;

$mail = new PHPMailer();

$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp.mydomain.com"; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "name@mydomain.com"; // SMTP username
$mail->Password = "password"; // SMTP password

$mail->From = "name@mydomain.com";
$mail->FromName = "PRODUCT";
$mail->AddAddress("$email", "$surn"wink;
//$mail->AddAddress("ellen@example.com"wink; // name is optional
//$mail->AddReplyTo("info@example.com", "Information"wink;

$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"wink; // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"wink; // optional name
$mail->IsHTML(true); // set email format to HTML

$mail->Subject = "PRODUCT REGISTRATION";
$mail->Body = "

<img src=', /img/jpy/nddclogo.jpg'/> \n\n

my msg after the logo

";
$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";

?>


any help will be gratefull
Re: Phpmailer Not Working by Easyphp: 5:47pm On Jun 23, 2010
have just added http:// to the link and is working now

but the images is not still working!
Re: Phpmailer Not Working by inf8nity(m): 7:08pm On Jun 23, 2010
Put the absolute URL for your image path e.g.

//$mail->AddAttachment("http://www.yourdomain.com/tmp/image.jpg", "new.jpg"wink


<img src=', http://www.yourdomain.com/img/jpy/nddclogo.jpg'/>

That should work! cheesy
Re: Phpmailer Not Working by honestseller34: 11:43am On Jan 03, 2014
Daily Professional Tools For Sale, 100% Trust !!!

(1) (Reply)

Who Knw Nairaland Simple Machine Forum Themes And Mod / How To Get More Likes For Your Facebook Pages / Finally ! Voguepay Payment Gateway Extension For Woocommerce That Works

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 24
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.