Jump to content

Search the Community

Showing results for tags 'phpmailer mail smtp tls'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am trying to use the phpmailer class to send a mail from a webform. I will substitute my mail server name with mail.example.com I am getting these errors SERVER -> CLIENT: CLIENT -> SERVER: EHLO localhost SERVER -> CLIENT: SMTP ERROR: EHLO command failed: SMTP NOTICE: EOF caught while checking if connected SMTP connect() failed. Mailer Error: SMTP connect() failed. I am trying to connect to my server and not to localhost. I changed the /etc/php5/apache2/php.ini on a debian system to and SMTP = mail.example.com ; http://php.net/smtp-port smtp_port = 465 then restart apache with /etc/init.d/apache2 restart Here is the code //Create a new PHPMailer instance $mail = new PHPMailer(); //Tell PHPMailer to use SMTP $mail->isSMTP(); //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages $mail->SMTPDebug = 2; //Ask for HTML-friendly debug output $mail->Debugoutput = "html"; //Set the hostname of the mail server $mail->Host = "mail.example.com"; //Set the SMTP port number - likely to be 25, 465 or 587 $mail->Port = 465; //Whether to use SMTP authentication $mail->SMTPAuth = true; // Enable encryption, "ssl" also accepted $mail->SMTPSecure = "tls"; //Username to use for SMTP authentication $mail->Username = "mailer@example.com"; //Password to use for SMTP authentication $mail->Password = "mailerpassword"; //Set who the message is to be sent from $mail->setFrom('mailer@example.com', 'Mailer do not reply'); //Set an alternative reply-to address //$mail->addReplyTo('replyto@example.com', 'First Last'); //Set who the message is to be sent to $mail->addAddress('receive@example.com', 'receive'); //Set the subject line $mail->Subject = 'PHPMailer SMTP test'; $mail->Body = 'mailer body test: '; //send the message, check for errors if (!$mail->send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } any help is appreciated
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.