This is beta for testing therefore backup everything you're going to change!
This extends eForm, without affecting the existing mail() method of sending, you just get the additional option of using SMTP.
Normally I'd post it in the development section, but it's more likely to find SMTP testers here.
I've attached a zip file containing:
instructions.rtf ( read before doing anything else! )
eform.snippet.php ( new MODx Snippet )
eform.inc.php ( main code for eForm )
6 new SMTP snippet parameters available & have the following default values :
<?php
'smtp' => isset($smtp)? $smtp:false, // false to use IsMail(); function, true to use IsSMTP(); function
'smtp_host' => isset($smtp_host)? $smtp_host:'', // e.g. smtp.your-domian.co.uk
'smtp_port' => isset($smtp_port)? $smtp_port:25, // e.g. 587 or another port, check with your hosting/email provider
'smtp_auth' => isset($smtp_auth)? $smtp_auth:'true', // true or false, check with your hosting/email provider but usually true
'smtp_user' => isset($smtp_user)? $smtp_user:$modx->config['emailsender'], // any valid SMTP user e.g. [email protected]
'smtp_pass' => isset($smtp_pass)? $smtp_pass:'', // whatever the password is for the user
I've only done limited testing, so be warned ;)
Post any bugs in the forum thread, I'm sure there are plenty!
Additionally I added a new parameter 'sender'.
I noticed some servers have the PHP 'sendmail_from' value default to '
[email protected]' the new sender parameter enables you to override it so your email header will have an accurate 'Return-Path' value.
<?php
'sender' => isset($sender)? $sender:$modx->config['emailsender'] // e.g. [email protected]
#1 EDIT zip file now contains a merged version of the security Mods by PMS, see link/suggestion by sharkbait in post#2 & the new SMTP functionality in
eform.inc.php
#2 EDIT zip file now contains an updated
eform.snippet.php to use sotwell's config suggestion in post#4
#3 EDIT zip file now contains a fixed version of
eform.inc.php, rectifying issues in post#6 also there is an
example.config.php file
#4 EDIT the snippet code was a duplicate of the main inc. file, my apologies, now corrected
[ed. note: bunk58 last edited this post 11 years, 3 months ago.]