Sending Mail Forms
Автор: Matija G.
Просмотрено 6710,
Подписчики 3,
Размещенный 78
Hi, is possible to send e-mail forms via SMTP server, because my mailserver blocked forms, send by X5? Matija
Размещено
. . . for sending mail (contact) you need to have PHP5 installed and working on server . . .
For other possibilities please read manual page 86 to 93 . . .
Автор
I have installed PHP 5.6.3.0 and it work for all other aplications without any problem!
Hello Matija,
WSX5 doesn't provide a direct SMTP access because PHP does not support it natively. Moreover, each SMTP server could require different settings.
Actually, your request is outside WebSite X5's jurisdiction but I can give you a tip on this.
WebSite X5 always uses the "email" function of PHP but you can "build" an SMTP access script on your own if you have a base knowledge of programming and PHP.
If you want to build your custom SMTP library for WSX5, you should do as follow:
1) In the email form settings, double click on each field. In the Field Settings Window, click on the "Options" tab and there set a name to the field using the "Name attribute" setting. This name will be used to identify the content of that field when the email form will be sent to your server.
2) Create a custom PHP file. It should retrieve each field from the email form using the $_POST array. In step 1, I've suggest to provide a value for the "Name attribute" of each field. For example, if you set "customer_name" as name of a field, the content of that field will be stored in $_POST['customer_name'] when the form will be sent to PHP. This PHP file must then build an email and send it using SMTP. I've found this interesting tutorial on how you can use SMTP in PHP: http://www.dreamincode.net/forums/topic/36108-send-emails-using-php-smtp-direct/
3) In the "Send" tab of the email form, choose "Send to file" and select your custom PHP script.
Hope this helps!
Has anybody created a custom php file which allows smtp mail ?
In your situation use:
www.coffeecup.com/form-builder
Used this myself in X5 as an example......
Frank
www.frankscybercafe.com
Hello, I´m from Brasil. I have difficult language english. Please how send mail smtp? My server block mail form.
Thank's.
Renato.
I just changed imemail.inc.php and added a few lines to send via smtp. edit the bits as you need to. The first 7 lines in bold are from the original file so you can see where the new parts go.
Now you will get 2 identical e-mails with the order info as the system tries to send one to your customer and the other to you. see below if you want to tidy it up after making this change.
ini_set("sendmail_from", $this->from);
$r = @mail($this->to, $this->subject, $msg, $headers, "-f" . $this->from);
if(!$r) {
$headers = "To: " . $this->to . "\r\n" . $headers;
$r = @mail($this->to, $this->subject, $msg, $headers);
}
include_once("Mail.php");
$From = "senders name <senders email>";
$To = "Recipient's name <recipients e-mail address>";
$Subject = "the subject";
$Message = $msg;
$Host = "outgoing mail server";
$Username = "username";
$Password = "password";
// Do not change bellow
$Headers = array ('From' => $From, 'To' => $To, 'Subject' => $Subject);
$SMTP = Mail::factory('smtp', array ('host' => $Host, 'auth' => true,
'username' => $Username, 'password' => $Password));
$mail = $SMTP->send($To, $Headers, $Message);
if (PEAR::isError($mail)){
echo($mail->getMessage());
} else {
}
return $r;
}
}
?>
Ok now you get 2 e-mails with the info, to stop this edit the bottom of imcartsend.php so it looks like this
//Send email to owner
$htmMsg = $htmHead . "<tr><td><b>" . $imOrderNo . "</b></td></tr>" . $htmFoot . "<br>" . $htmHead . $imOrderDataHTML . $htmFoot . "<br>" . $htmHead . $imUserDataHTML . $htmFoot . "<br>" . "";
$oEmail = new imEMail(($imForceSender ? $_POST["imUserMail"] : "***"),"***",$imOrderNo,"iso-8859-1");
$oEmail->setText($imOrderNo . "\n\n" . $imOrderDataTxt . "\n\n\n" . $imUserDataTxt . "\n\n\n");
$oEmail->setHTML("");
$oEmail->send();
@header("Location: ../impayment.html");
?>
Now you get one simple e-mail with the order info and buyers e-mail address, just forward it to the buyer when you deal with the order.