Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:43:23+00:00 2026-06-16T13:43:23+00:00

I am using following configuration for sending mail through php mail function : function

  • 0

I am using following configuration for sending mail through php mail function :

function sendInvoiceEmail() {

GET CUSTOMER EMAIL

        $recieverEmail = xyz@test.com; //Valid Email ID
        $recieverName = xyz; 

CREATE EMAIL CONFIGURATION ARRAY

    $emailConfig = array(
            'protocol' => 'smtp',
            'smtp_host' => 'ssl://smtp.googlemail.com',
            'smtp_port' => 465,
            'smtp_user' => 'abc@abc.com',   //Valid Email ID
            'smtp_pass' => 'password',      //Valid password
            'mailtype' => 'html', //text or html
            'charset' => 'iso-8859-1',
        );

Set your email information

        $from = array('email' => 'abc@abc.com', 'name' => 'Testing');

    $to = array('email' => $recieverEmail, 'name' => $recieverName);
        $subject = "Test Mail for Invoice ";

        $message = "Test Message for Invoice";

Load CodeIgniter Email library

        $this->load->library('email', $emailConfig);
        $this->email->initialize($emailConfig);

Sometimes you have to set the new line character for better result

        $this->email->set_newline("\r\n");

Set email preferences

        $this->email->from($from['email'], $from['name']);
        $this->email->to($to['email'], $to['name']);
        $this->email->subject($subject);
        $this->email->message($message);

Ready to send email and check whether the email was successfully sent

        if ($this->email->send()) {
            return true;
        } else {
            show_error($this->email->print_debugger());                
        }
    }

I am having PHP 5.3.9 version and wampserver but I am getting following error :

An Error Was Encountered

The following SMTP error was encountered: 52770504 Unable to find the socket 
transport "ssl" - did you forget to enable it when you configured PHP?
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:

from: 

The following SMTP error was encountered:
Unable to send data: RCPT TO:

to: 

The following SMTP error was encountered:
Unable to send data: DATA

data: 

The following SMTP error was encountered:
Unable to send data: User-Agent: CodeIgniter Date: Thu, 27 Dec 2012 16:50:28 
+0530 From: "Invoice Tester" Return-Path: To: df@df.kl Subject: =?iso-8859-1?Q?Test_Mail_for_Invoice_?= Reply-To: "sujit.singh@xpointers.com" X-Sender: sujit.singh@xpointers.com X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <50dc2efca4149@xpointers.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_50dc2efca4160" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_50dc2efca4160 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Test Message for Invoice --B_ALT_50dc2efca4160 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Test Message for Invoice --B_ALT_50dc2efca4160--
Unable to send data: .

The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to 

send mail using this method.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:43:24+00:00Added an answer on June 16, 2026 at 1:43 pm

    I know about wampserver there is setting in PHP Extension so if you are using wampserver then you can do the following step :

    1) Go to WampSever Tray icon

    2) Go to PHP Extension

    3) Search for php_openssl

    4) If it is not checked then mark it as checked (php_openssl)

    Otherwise you can refer Michael’s answer 🙂

    Hope it will help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

before few days i have been comfortably sending emails using PHP mail function. but
I'm trying to get zc.buildout to install Gunicorn from source. Using the following configuration:
I am using following WordPress plugin to send email. http://coffee2code.com/wp-plugins/configure-smtp/ I have done configuration,
I am trying to host my service using following configuration. <system.serviceModel> <services> <service name=Test.MyService
I am using the following configuration for NGinx currently to test my app :
I am sending email using the following utility class, if receiver foo@foo.com is not
I'm sending some queries using Java client API. but I get following error after
I am using Java Mail API Ver. 1.4.2 for sending out email in JSF
I am using following configuration to properly fit image inside a scrollview. <?xml version=1.0
Is it possible to disable retries in NServiceBus, version 3.2.2? Using the following configuration,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.