Support Forum

 
You must be logged in to post
Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

Posted data in emails is being sent in one line

Information/How to
UserPost

8:41 am
June 9, 2011


kb

1

Hi using WordPress 3.1.2, Formidable 1.05.02 & WP-Mail-SMTP.

 

The emails are coming through ok just that the form labels and posted values are being sent all in one line making it hard to read.

 

e.g Body Message

Contact Us form has been submitted on [website name]. First name: Fred Surname: Bloggs Email: fred@bloggs.co.uk

 

I've checked the headers and the content type is text/html.

 

Any clues please?

 

KB

2:04 pm
June 9, 2011


Steph

2

If you are sending mail through and SMTP plugin, the settings like this may be getting overridden. Please check your settings there and ask the developers of that plugin if you're not able to find a setting to change this.

3:01 am
June 10, 2011


kb

3

Hi thanks for getting back.

The plugin makes all wordpress emails goes through it. It reconfigures the wp_mail() function to use SMTP instead. So I tested it with the Password reminder and the format of that email comes through fine.

 

I've also tried deactivating the plugin and then trying a formidable form submit – same again all body message on one line. So I don't think its the SMTP Email plugin. 

 

Could it be that the formidable form data that goes in the message is built as plain text (\r \n), but when the email is being sent via wp_mail() its headers are are being set as text/html but the email client can't see any html to render?

 

Reason I ask is when I view the source of my Password reminder email I saw BR tags, when I saw the source of my formidable form email there was no html – but look like there was some \r or \n

3:43 am
June 10, 2011


kb

4

Ok I've had some joy whilst digging around in the code.

file: wp-content/plugins/formidable/classes/FrmNotification.php

 

Around line #59 – function send_notification_email($to_email, $subject, $message, $reply_to='', $reply_to_name='', $plain_text=true)

 

I changed the $plain_text=false. Then I also added a few BR tags where the form values had '\r\n'. This then meant the IF condition at line #71 that checks to see if $plain_text=true then strip_tags and html_entity_decode – now fails and now the emails come through formatted fine.

 

Only problem is this is a hack – and will get wiped in future updates!

Any ideas on how to make this not a hack?

3:26 am
June 13, 2011


kb

5

Hi having found where the problem is – anyone have any thoughts on how best to move on this one?

Thanks

KB

Information/How to