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

  • Home
  • SEARCH
  • 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 7673125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:26:23+00:00 2026-05-31T16:26:23+00:00

I cant send the email message via gmail smtp on swift mailer, here is

  • 0

I cant send the email message via gmail smtp on swift mailer, here is the code:

<?php

require_once 'inc/swift_mailer/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
  ->setUsername('mysen2@gmail.com')
  ->setPassword('bestpasswordever')
  ;
$transport->setLocalDomain('[127.0.0.1]');
$mailer = Swift_Mailer::newInstance($transport);

$message = Swift_Message::newInstance($transport)
  ->setSubject('Test Mail')
  ->setFrom(array('mysen2@gmail.com' => 'John Doe'))
  ->setTo(array('testin3@gmail.com'))
  ->setBody('This is the test message.')
  ->addPart('<q>Here is the message itself</q>', 'text/html');
  
    if (!$mailer->send($message, $failures))
    {
        die("Errors occurred:<br/>" . $failures);
    }

?>

And the error message:

Fatal error: Uncaught exception ‘Swift_TransportException’ with
message ‘Connection could not be established with host smtp.gmail.com
[Unable to find the socket transport "ssl" – did you forget to enable
it when you configured PHP? #-27264]’ in
/swift_mailer/lib/classes/Swift/Transport/StreamBuffer.php:266
Stack trace: #0
/swift_mailer/lib/classes/Swift/Transport/StreamBuffer.php(66):
Swift_Transport_StreamBuffer->_establishSocketConnection() #1
/swift_mailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(117):
Swift_Transport_StreamBuffer->initialize(Array) #2
/swift_mailer/lib/classes/Swift/Mailer.php(79):
Swift_Transport_AbstractSmtpTransport->start() #3
/usr/local/www/data/mail.php(19):
Swift_Mailer->send(Object(Swift_Message), Array) #4 {main} thrown in
/swift_mailer/lib/classes/Swift/Transport/StreamBuffer.php
on line 266

I guess its a problem with my server not containing the open ssl library:

[Unable to find the socket transport "ssl" – did you forget to enable
it when you configured PHP?

How can I fix that , then?

also

Is using gmails SMTP good for sending like 50-100 mails per day? Or I should use something else (you’re free to suggest and give me some tips)?

  • 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-05-31T16:26:25+00:00Added an answer on May 31, 2026 at 4:26 pm

    You can fix the [Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? by recompiling PHP using the --with-ssl[=DIR] option.

    In order to be able to do that, you have to install the OpenSSL libraries onto your server. Depending on your OS, you can do something like apt-get install openssl-dev on Debian/Ubuntu, or yum install openssl-devel on RedHat/CentOS/Fedora.

    Alternatively, you can just download and compile the latest version of OpenSSL yourself and use that with PHP.

    If you do not run your server, then you need to ask your host to enable SSL in PHP for you.

    Also: Gmail may work okay for sending 50-100 emails per day. It depends though. See their Program Policies for Gmail which does not go into a lot of detail. It sounds like if you have a pre-existing relationship with the 50-100 people you are emailing per day, then you may not be violating any terms, but you may want to confirm that by contacting them directly or doing more searching about their terms.

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

Sidebar

Related Questions

I am using this code to send email var message = new MailMessage(abc@somedomain.com, administrator@anotherdomain.com);
Here's my updated code trying to get my form to send me the email.
I've downloaded a sample application sending email silverlight application here. via gmail. But I
I cant get a PHP file to send correct headers at my WAMP server.
I'm trying to send an email from my application with a PHP contact form,
I am trying to send an email using c# using the following code. MailMessage
I've already set sendmail_path to the path of 'sendmail.exe', but PHP didn't send email.
I can't send email to my app users, even though I have the permissions.
I cant post the code (proprietary issues) but does anyone know what types of
I am using the MessageUI framework to send and image via e-mail after taking

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.