Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Content E-mail as HTML

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
hamongnguyet
Smarty n00b


Joined: 13 Jan 2019
Posts: 1

PostPosted: Sun Jan 13, 2019 3:33 pm    Post subject: Content E-mail as HTML Reply with quote

Hi,

I use the following code to send an e-mail:

[php]
Code:

$smarty->assign('name', $_POST['name']);
$smarty->assign('email', $_POST['email']);
$smarty->assign('subject', $_POST['subject']);
$smarty->assign('content', $_POST['content']);
mail($globals['email'], $_POST['subject'], $smarty->fetch('form_body.tpl'), 'From: Our website <' .$globals['email']. '>', '-f ' .$globals['email']. '');


[template]
Code:

Dear webmaster,

{$name} has contacted us through our webste. Here's the message::

Name: {$name}
E-mail address: {$email}
Subject: {$subject}
Content:
{$content}

*******************************
This e-mail message is intended exclusively for the addressee. If the e-mail was sent to you by mistake, please return it to us.
*******************************
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1545

PostPosted: Mon Jan 14, 2019 4:33 pm    Post subject: Reply with quote

If that was a question, I did not get it.
Please repost your issue with an actual question/statement of your problem.
Closing topic now to prevent spam.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP