WebSite X5Help Center

 
Jens V.
Jens V.
User

Contact form  en

Author: Jens V.
Visited 1933, Followers 2, Shared 0  

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); }

Posted on the
3 ANSWERS
Incomedia
Claudio D.
Incomedia

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.

Read more
Posted on the from Claudio D.
Jens V.
Jens V.
User
Author

Hello Claudio

Since I am not a programmer, I have absolutely no idea of what the suggestion you give means?

Regards

Jens

Read more
Posted on the from Jens V.
Incomedia
Claudio D.
Incomedia

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!

Read more
Posted on the from Claudio D.