Forums

TEXT EMAIL

EPS 21 Nov, 2007
Hi...
is there a solution to chance the email format from HTML to (pure) TEXT?

Thanks For Your Help.
GreyHead 21 Nov, 2007
Hi EPS,

Yes, but you need to hack the code. In chronocontact.php look for this code near the end line 438 in my version
/**
 * Send the email(s)
 */
$email_sent = mosMail($from, $fromname, $recipient, $subject, $html_message, true, $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name);
add one line and change 'true' to $mode
if ( !($mode === false ) { $mode = true };
  $email_sent = mosMail($from, $fromname, $recipient, $subject, $html_message, $mode, $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name);
Now you'll need to include
<?php $mode = true; ?>
in the OnSubmit before email field.

The overrides ChronoForms assumption that it will send html emails and setting $mode = false tell it to send a plain text email, if you don't do this then it will continue to send html emails.

Note: Not tested and the === comparison may be too sensitive, try == if you get odd results.

Bob
EPS 21 Nov, 2007
i have all done like you tell me.

now i opening the form i get this:

Parse error: syntax error, unexpected '{' in ...htdocs/members/components/com_chronocontact/chronocontact.php on line 461



Line 461: if ( !($mode == false ) { $mode = true };
$email_sent = mosMail($from, $fromname, $recipient, $subject, $html_message, $mode, $ccemails, $bccemails, $attachments, $replyto_email, $replyto_name); [file name=chronocontact-68c1e199816e8939d8c536768d9bcbf0.zip size=4954]http://www.chronoengine.com/components/com_fireboard/uploaded/files/chronocontact-68c1e199816e8939d8c536768d9bcbf0.zip[/file]<br><br>Post edited by: EPS, at: 2007/11/21 13:28
GreyHead 21 Nov, 2007
Hi EPS,

Sorry, I missed a ')' in there - should be:
if ( !($mode == false ) ) { $mode = true };
Bob
EPS 21 Nov, 2007
hmm... am i stupid?

still got: Parse error: syntax error, unexpected '}' in ../htdocs/members/components/com_chronocontact/chronocontact.php on line 461


here's the: chronocontact.php
[file name=chronocontact-9fe0c3153e3f4c567da2c444a8ff40d3.zip size=4953]http://www.chronoengine.com/components/com_fireboard/uploaded/files/chronocontact-9fe0c3153e3f4c567da2c444a8ff40d3.zip[/file]


well i have a second wish: please include a switch for a) HTML b) TEXT-Mail Format :-)<br><br>Post edited by: EPS, at: 2007/11/21 14:09
GreyHead 21 Nov, 2007
Hi EPS,

No not you, me - I missed a *** ; as well!!!
 if ( !($mode == false ) ) { $mode = true; };
Bob

PS Memo to self - don't try to write code straight into emails!<br><br>Post edited by: GreyHead, at: 2007/11/21 15:16
EPS 21 Nov, 2007
ok, now it works.

ähm... no it works not.

the mail is still a HTML-Mail

(a HTML File in attachement)

i want a plain text email, without attachement :-)
Max_admin 22 Nov, 2007
Hi EPS,

after applying all Bob's steps, please find this piece of code and cooment/delete it :


$html_message = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
						  <html>
							  <head>
								  <title></title>
								  <base href=\"$mosConfig_live_site/\" />
								  <style type=\"text/css\">
								  ".strip_tags( $chronocontact_params->get('newsletter_css'))."
								  </style>
							  </head>
							  <body>$html_message</body></html>";


Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
EPS 22 Nov, 2007
Good Morning.

Thank for all yours trouble :-)

But it still don't work.

[...]
X-Mailer: PHPMailer [version 1.73]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="iso-8859-1"
X-RZG-CLASS-ID: cg00



[file name=chronocontact-afb6049dbb19f3a141441a0ab17a1d96.zip size=4774]http://www.chronoengine.com/components/com_fireboard/uploaded/files/chronocontact-afb6049dbb19f3a141441a0ab17a1d96.zip[/file]<br><br>Post edited by: EPS, at: 2007/11/22 10:55
EPS 22 Nov, 2007
And the Message.HTML [file name=Message.zip size=454]http://www.chronoengine.com/components/com_fireboard/uploaded/files/Message.zip[/file]
Max_admin 23 Nov, 2007
try to use the template option after making all the hacks above ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
EPS 23 Nov, 2007
Si senore :-)

i have attached the all edited file...
Max_admin 23 Nov, 2007
Hi, No, I mean you set the email type to "template" and not "fields", make your template pure text of course, this works ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
EPS 23 Nov, 2007
oh i have overead that.

now it's done and i received a empty (HTML) mail.

looks like this: [file name=Message-c412194e532c4b919fb1f645e5ec741d.zip size=160]http://www.chronoengine.com/components/com_fireboard/uploaded/files/Message-c412194e532c4b919fb1f645e5ec741d.zip[/file]<br><br>Post edited by: EPS, at: 2007/11/23 10:18
Max_admin 24 Nov, 2007
Hi EPS,

This will need some investigations, I will look into it and maybe include a new option for the email type at the next release!

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
EPS 26 Nov, 2007
Thanks a lot for your effort.

This were a very helpful feature to process the/a received mail automaticly.

So i hope for the next Version ;-)
This topic is locked and no more replies can be posted.