Contact form
Autore: Jens V.Hello Again I have problems with the way version 9 sends the contactform data as mail. My host does not support mails, that are sent via a login to my mailaccount. They suggest the below php script. I have no idea how to implement this on my site. Please help anyone?
<!--?php require_once "Mail.php"; $to = ""; $subject = "TEST MESSAGE "; $body = "TEST MESSAGE BODY".var_export($SERVER, true); $host = "mail.talkactive.net"; $port = 587; $username = '***'; $password = 'mailaccountpassword'; $headers = array ('From' =-->$username, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ( 'host' => $host, 'port'=>$port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("" . $mail->getMessage() . "".PHP_EOL); } else { echo("Message successfully sent!".PHP_EOL); } ?>
With SSL: $username, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ( 'host' => $host, 'port'=>$port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("" . $mail->getMessage() . "".PHP_EOL); } else { echo("Message successfully sent!".PHP_EOL); }
Hello Jens,
Unfortunately I cannot help you with the use of custom code. You can use the HTML&widget Object in step 3 and then you add the code. Remember to change the page extension to php in step 2 page properties otherwise it will be not interpreted once exported online.
If you require any further information, please feel free to write back.
Autore
Hello Claudio
Since I am not a programmer, I have absolutely no idea of what the suggestion you give means?
Regards
Jens
Hello Jens,
Generally speaking since the functions do not depend on WebSite X5 I cannot help you with the custom code. I can explain you how to add it but I cannot give support to the code itself.
You will need to adapt the code to your hosting provider settings, which they have to provide you and then you can add the code in the HTML&Widget Object in step 3 in the page you want to have it.
Once done you need to select the same page in step 2 and then open the properties and in the Expert tab you need to change the file name format from HTML to PHP.
Many thanks!