Hotmail stripping code from emails

I don't know if it's a setting of mine or if hotmail strip all html code from emails.

I'm currently working on the email templates and want to include things like the site logo, text formatting and so on and the messages look as I intend them to look when I preview them.

However, when I send the email to my hotmail account (for testing purposes, obviously), most of the code is missing with only un-anchored links showing in the messages. Is this a hotmail issue and would the messages send to a non-hotmail account as they look in the preview or am I doing something wrong?

Quote · 12 Sep 2008

As for me there is no specific Hotmail HTML problem...

Maybe try to compare your Email Templates with the source of a Hotmail message... or post here one of your Email Template ;-)

Life is a fatal disease, sexually transmissible - Virginity is carcinogenic! Ask here for vaccine.
Quote · 12 Sep 2008

It must be a problem with my mailserver/hotmail because I DO get html formatted emails from other sources. I've checked back to the first email that I receieved from my site and that didn't have any of the formatting either (that was before I edited any templates).


Btw, does anybody know how to view the source/header in hotmail's web interface, I can't find a single option that will allow me to.. :/

Quote · 12 Sep 2008

update...

some mails come through in html format, some don't.. why that is I'm hoping someone can tell me..

All the mail templates have the same code at both the top and bottom of the template, things like account confirmation, admin mails, account activation mails have no html formatting. Their headers show them as "text/plain; charset=UTF-8".

The "someone has purchased" and "you have bought" mails come through as html and the headers say "text/html; charset=UTF-8".

Presumably then, this is something to do with the script after all?

I've also noticed another problem though, in the "you have bought" mail it says contact the buyer directly, in the "someone has purchased" mail it says contact the seller directly. I haven't edited the message body in any way..

"<div style="padding:3px 3px 10px;">
Item title: <Subject><br/>
Seller`s Name: <NickName><br/>
Seller`s email: <EmailS><br/><br/>
Buyer Name: <NickNameB><br/>
Buyer email: <EmailB><br/><br/>
Price details: <sCustDetails><br/><br/>
Link to Item<br/>
<a href="<ShowAdvLnk>"><ShowAdvLnk></a><br/><br/>
Contact the <Who> directly to arrange payment and delivery. To avoid fraud, we recommend dealing locally, avoiding Western Union and wire transfers.<br/><br/>"

Obviously they are the wrong way round, i.e. the buyer should say seller and vice-versa. Can anybody tell me how to fix both the html problem and how to switch the buyer/seller <Who> please?

Quote · 12 Sep 2008

Not sure about the text/HTML but you can edit the messages at:
Admin > settings > Email Templates ..... 


HOW TO SEARCH AND NOTE FOR NEW MEMBERS IN THE FORUMS .....
.

Quote · 12 Sep 2008

I have edited the message templates, that's how I'm discovering the errors..

the code for buyer/seller in the templates is the same, i.e. <Who> so how do I make it so that the email the buyer gets says contact the seller and vice-versa because it's that <who> that's at fault, not my editing (or my searching abilities).

Quote · 12 Sep 2008

I've fixed the buyer/seller problem by editing this section in /inc/classes/BxDolClassifieds.php

$sRetHtml = '';
$aPlus['Who'] = 'buyer';
$aPlus['String1'] = 'You have purchased an item';
if (sendMail( $aSqlMemberRes['Email'], $sSubject, $sMessageB, $aSqlSellerRes['ID'], $aPlus, 'html')) {
//$sRetHtml .= MsgBox(_t('_Email was successfully sent'));
}
$aPlus['Who'] = 'seller';
$aPlus['String1'] = 'Someone wants to purchase an item that you have offered for sale';
if (sendMail( $aSqlSellerRes['Email'], $sSubjectS, $sMessageS, $aSqlSellerRes['ID'], $aPlus, 'html')) {
$sRetHtml .= MsgBox(_t('_Email was successfully sent'));

Basically, I swopped around "$aPlus['Who'] = 'buyer';" and "$aPlus['Who'] = 'seller';" so that it now reads:


$sRetHtml = '';
$aPlus['Who'] = 'seller';
$aPlus['String1'] = 'You have purchased an item';
if (sendMail( $aSqlMemberRes['Email'], $sSubject, $sMessageB, $aSqlSellerRes['ID'], $aPlus, 'html')) {
//$sRetHtml .= MsgBox(_t('_Email was successfully sent'));
}
$aPlus['Who'] = 'buyer';
$aPlus['String1'] = 'Someone wants to purchase an item that you have offered for sale';
if (sendMail( $aSqlSellerRes['Email'], $sSubjectS, $sMessageS, $aSqlSellerRes['ID'], $aPlus, 'html')) {
$sRetHtml .= MsgBox(_t('_Email was successfully sent'));

Now the email to the seller says contact the buyer and vice versa :)

Still none the wiser re: some mails being HTML format and some not, anybody?

Quote · 12 Sep 2008

Ok  .....   you beat me to it  ..... 

Other than 2 references in the database which were n/a the BxDolClassifieds.php file was the only one that contained the word "who" (without quotes)  ..... 

The question or what decides whether a HTML or plain text email is sent has been a mystery that so far no one seems to know the answer to  ..... 
.

Quote · 12 Sep 2008

I think I might have found that too :)

But, not sure.. in /periodic/notifies.php it says:

if ( $count_ok < $total_count ) {
// Profiles Messages
$nfs_res = db_res("
SELECT
NotifyQueue.Email as ID1,
NotifyQueue.Msg as ID2,
Profiles.NickName as Name,
Profiles.Email,
NotifyMsgs.Subj,
NotifyMsgs.HTML as Body
FROM NotifyQueue  
INNER JOIN NotifyMsgs ON
(NotifyMsgs.ID =  NotifyQueue.Msg)
INNER JOIN Profiles ON
(Profiles.ID = NotifyQueue.Email)
WHERE
NotifyQueue.`From` = 'Profiles' AND
Profiles.EmailNotify  = 'NotifyMe'
",0 );

But the next bit of code says:

if ( $count_ok < $total_count ) {
// Profiles Messages
$nfs_res = db_res("
SELECT
NotifyQueue.Email as ID1,
NotifyQueue.Msg as ID2,
NotifyQueue.MsgText as Body,
NotifyQueue.MsgSubj as Subj,
Profiles.NickName as Name,
Profiles.Email
FROM NotifyQueue
INNER JOIN Profiles ON
(Profiles.ID = NotifyQueue.Email)
WHERE
NotifyQueue.`From` = 'ProfilesMsgText' AND
Profiles.EmailNotify  = 'NotifyMe'
",0);

Just a guess, but could that be why??

Quote · 12 Sep 2008

maby users settings into email client is the connection here, like the site is sending out both version (html + plain) but depended on your e-mail client setting you get html or plain???? its a idea

Kids first
Quote · 12 Sep 2008

well yeah, that's what I thought at first but I don't think it can be as, no matter which client I use, the ones that come as html are html in all clients, the ones as text are text in all clients (hotmail/outlook/horde webmail are the three I've tested).

I'm pretty sure there is something missing somewhere when it comes to certain mails that are sent, just dunno what/where it is?

Quote · 12 Sep 2008

It appears it could be the "notifies" part of it  ..... 


You could test the theory by commenting out the first section for the HTML  ..... 

Add a /* just before the block and a */ just after to test  ..... 

.

Quote · 12 Sep 2008

me to I have recheckting every setting, but found no connection to the way the mail is sending out the differend versions.
So lets ask AndreyP for some explanation :)

Kids first
Quote · 12 Sep 2008

hmm, I was thinking that it was this line

"NotifyQueue.MsgText as Body,"

that could be at fault, like I said, I'm guessing but the first two bits of code both mention html as body, the last bit doesn't..

and good old M$ and SenderID don't like the refer a friend emails, (they do come in HTML though).. flagged as 'dangerous' because the 'from' field says one thing but the actual origin is obviously my site and not the email in the from field (my 'friends')

Quote · 12 Sep 2008

anybody know the answer to this? I admit I haven't tried what I *think* could be the cause, mainly because I don't want to break anything else. It would be nice if someone with a bit better knowledge than me were to look into this, I assume that I'm not the only person who gets some mails in html and others not...

Quote · 14 Sep 2008

I tried several messages the other day and just now went back and looked through older messages and I cannot find any at all with HTML  .....  not even text/HTML  ..... 
They are all in plain text(ASCII) only so I cannot even get a benchmark to test against  .... 
.

Quote · 14 Sep 2008

oh, well I do get some HTML mails..

buy now mails to both buyer and seller are in html as are invite a friend mails..

chron database error messages (I've had lots) are ascii but show html code in them, messages from admin (sent via acp/members), confirmation links, messages sent to site inbox/email, notify of new message in site inbox, spam reports and activated account mails are in ascii ...

not tested any others yet, not sure if I'll be using them at all..

Quote · 14 Sep 2008

Hmmmmmmmm  .....   I'd be glad to test it if I could get it (v6.1.4) to send a HTML message  ..... 

My database  error messages are in plain text also with no HTML  ..... 
Content-type: text/plain; charset=UTF-8
.

Quote · 14 Sep 2008

not the database error messages they are text, but the cron error messages at the same time, just like you would get a big red/white warning message on the site itself, that gets sent via cron only its just code...

Subject: Cron <root@server8> /usr/local/bin/php -q /home/tradeinf/public_html/periodic/cupid.php‏

Body:

<div style="border:2px solid red;padding:4px;width:600px;margin:0px auto;">
<div style="text-align:center;background-color:red;color:white;font-weight:bold;">Error</div>
<div style="text-align:center;">Database query error</div>
</div>


On the site that would be a red/white banner error message.

Quote · 14 Sep 2008

Ok  .....  the tell-a-friend is hardcoded in the /tellfriend.php file  .....  v6.1.4

Find "Content-type: text/html" (without quotes) and change to "Content-type: text/plain" (without quotes)

Go to Admin > Settings > Advanced Settings > Email Templates > Template for "Invite a Friend" feature and copy the text version to the HTML version  .....


BadaBINGbadaBOOM  .....  no HTML  ..... 

I have a feeling the rest of them will be similar  .....  Just watch the page name where you are when something is sent and it should lead you to it  ..... 
.

Quote · 14 Sep 2008

ok, that didn't work...

I found two instances of mail header in /inc/utils.inc.php one said Content-type text/html the other said Content-type text/plain, changed plain to html ..

and it naffed the mails and set cron daemon off on one again.. replaced the backup file and still didn't work, had to replace it with an original from the install files :/

Quote · 14 Sep 2008
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.