joseph Posted June 10, 2007 Share Posted June 10, 2007 I have search about htmlspecialchars_decode: http://www.phpfreaks.com/phpmanual/page/function.htmlspecialchars-decode.html But not sure how to implement them on sendmail functions. $subject = $params['subject']; $body = $params['body']; $replacements = array(); $replacements['{sitename}'] = $mosConfig_sitename; $replacements['{name}'] = $invitor; foreach ( $replacements as $search => $replace ) { $subject = str_replace( $search, $replace, $subject ); $body = str_replace( $search, $replace, $body ); } $mail = mosCreateMail( $mosConfig_mailfrom, $mosConfig_fromname, $subject, $body ); $mail->AddAddress( $this->invitee_email ); $mail->IsHTML( false ); if ( !$mail->Send() ) { $this->_error = 'mosMail error!'; return false; } The mails I received are having <br /> tags but html are actually being decoded. What I want is to decode those <br /> tags and make them disappear but maintains having the line space when I received my mails. I'm thinking that I might need the strip tags php function? But how do I implement them on this $mail? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/54966-how-to-decode-the-tags-i-receive-in-my-email/ Share on other sites More sharing options...
wildteen88 Posted June 10, 2007 Share Posted June 10, 2007 If you are sending html code in your email you will need to send the html header with your email. But looking at your code it looks like you need to change this line: $mail->IsHTML( false ); to this: $mail->IsHTML( true); Quote Link to comment https://forums.phpfreaks.com/topic/54966-how-to-decode-the-tags-i-receive-in-my-email/#findComment-271945 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.