Yann63 Posted May 25, 2013 Share Posted May 25, 2013 Hello How can I add a specific font and fontsize to my mail body ? require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // Laat PHPMailer gebruik maken van een smtp server. $mail->Host = "smtp.mijnhostingpartner.nl"; // SMTP server van Mijn Hosting Partner $mail->SMTPAuth = true; $mail->Username = '[email protected]'; // Een geldig emailadres wat aangemaakt is bij Mijn Hosting Partner$mail->Password = 'yr2805'; // Het wachtwoord wat bij het emailadres hoort $mail->FromName=$_POST['NAAM'];$mail->Sender=$_POST['EMAIL']; $mail->AddAddress("[email protected]");$mail->Subject = $subject; $mail->Body = $text; $mail->IsHTML(true); //Opmaak van de email is in HTML if(!$mail->Send()){ echo "Error sending: " . $mail->ErrorInfo;;} echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';?> Link to comment https://forums.phpfreaks.com/topic/278378-add-font-in-phpmailer/ Share on other sites More sharing options...
PravinS Posted May 25, 2013 Share Posted May 25, 2013 Try this $mail->Body = '<span style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px">'.$text.'</span>'; Link to comment https://forums.phpfreaks.com/topic/278378-add-font-in-phpmailer/#findComment-1432212 Share on other sites More sharing options...
jazzman1 Posted May 25, 2013 Share Posted May 25, 2013 When you're trying to send emails as html document use only inline css, something like: <p style="color: red;">Your Text</p> @pbs, as I can see the Body is a property and should treat a css as a text, I think this is wrong but....I've never used phpMailer before and not sure. Link to comment https://forums.phpfreaks.com/topic/278378-add-font-in-phpmailer/#findComment-1432214 Share on other sites More sharing options...
Yann63 Posted May 25, 2013 Author Share Posted May 25, 2013 Thanks mate ! Link to comment https://forums.phpfreaks.com/topic/278378-add-font-in-phpmailer/#findComment-1432217 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.