Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    invio email con phpmailer

    Ciao a tutti, ho un problema con l' invio di una email con la classe PHPmailer.
    In locale mi da questo errore:
    2016-10-23 08:54:45 Extension missing: openssl Mailer Error: Extension missing: openssl
    e mi hanno detto che mi manca openSSL. Su server invece che mi hanno assicurato che c' è istallato openSSL, quando eseguo lo script non mi fa nessun print e l' apache non mi logga nessun errore e la mail non arriva a destinazione. Posto il codice grazie.

    Codice PHP:
    $mail = new PHPMailer();
    $body 'Test Mail';
    $mail->IsSMTP(); // telling the class to use SMTP
    $mail->SMTPDebug 2// enables SMTP debug information (for testing) // 1 = errors and messages// 2 = messages only
    $mail->SMTPAuth true// enable SMTP authentication
    $mail->SMTPSecure "tls"// sets the prefix to the servier
    $mail->Host "smtp.blackskip.com"// sets GMAIL as the SMTP server
    $mail->Port 587// set the SMTP port for the GMAIL server
    $mail->Username "admin@blackskip.com"// GMAIL username
    $mail->Password "*****"// GMAIL password
    $mail->SetFrom('noreplay@blackskip.com''First Last');
    //$mail->AddReplyTo("name@yourdomain.com","First Last");
    $mail->Subject "PHPMailer Test Subject via smtp (Gmail), basic";
    $mail->AltBody "To view the message, please use an HTML compatible email viewer!"// optional, comment out and test
    $mail->MsgHTML($body);
    $address "cldgcm@gmail.com";
    $mail->AddAddress($address"John Doe");
    //$mail->AddAttachment("images/phpmailer.gif"); // attachment
    //$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
    if(!$mail->Send()) 
    {
       echo 
    "Mailer Error: " $mail->ErrorInfo;

    else 
    {
       echo 
    "Message sent!";


  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2016
    Messaggi
    783
    Controlla tu stesso che ci sia openSSL facendo un

    Codice PHP:
    phpinfo() 

    Solitamente negli ambienti condivisi openSSL è compilato dentro il php ma alcune volte (spesso in ambiente windows) può essere presente come estensione, in quel caso va abilitato nel file php.ini

  3. #3
    Ho risolto, è aruba che vuole il parametro "starttls" invece di "tls". Grazie comunque.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.