Jump to content

smtp problem


Recommended Posts

hello,

a few days do not work and email from PrestaShop, either as new user registration, nor the contact form.
After some checking I discovered that my hosting requires auntetificazione smtp to send mail from your website.

And now? how can I do?

they have put a sample code ...
but do not understand much. can you help me?

I have put a sample script but I do not know how to do


<?php



require_once "Mail.php"; //INCLUDE LA LIBRERIA PEAR



$from = "Sandra Sender "; //EMAIL MITTENTE

$to = "Destinatario "; //EMAIL DESTINATARIO

$subject = "Hi";

$body = "Hi,\n\nHow are you?";



$host = "localhost";

$username = "admin@DOMINIO"; //SOSTITUIRE CON L'EMAIL AMMINISTRATORE

$password = "PASSWORD"; //PASSWORD



$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, $body);



if (PEAR::isError($mail)) {

echo("

" . $mail->getMessage() . "

");

else

echo("

Message successfully sent!

");



?>
Link to comment
Share on other sites

You don't need to do anything complicated.
Login into your admin panel.
Then go to Preferences.
Click on E-mail.
Click on Set my own SMTP parameters. For advanced users ONLY
and voilá! Set the SMTP server, user, password, encryption (maybe none), and port (maybe 25)

If this solve your question please change the topic to [sOLVED]

A hug from Portugal.

Link to comment
Share on other sites

×
×
  • Create New...