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 5989301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:04:55+00:00 2026-05-22T23:04:55+00:00

Having big problems trying to get my php script to send email. Using this

  • 0

Having big problems trying to get my php script to send email. Using this script on my mac:

 <?php

require_once 'lib/swift_required.php';  
$image = file_get_contents("php://input");  
$attachment = Swift_Attachment::newInstance($image, 'submission.jpg', 'image/jpg'); 

$message = Swift_Message::newInstance()  
    /*Give the message a subject*/  
    ->setSubject('Your subject')  
    /*Set the from address with an associative array*/  
    ->setFrom(array('email'=>'Name'))  
    /*Set the to addresses with an associative array*/  
    ->setTo(array('email'))  
    /*Give it a body*/  
    ->setBody('Email'); 
    $message->attach($attachment);//<--When the attachment above is commented out, so is this  

    $transport = Swift_SendmailTransport::newInstance();  
    $mailer = Swift_Mailer::newInstance($transport);  
    $mailer->send($message); 

?>

email sends fine, attaches the image and is great. However this doesn’t work on windows. I’ve read windows doesnt have a mail server so have spent that last few days fighting with hmailserver, mercury, mailsender etc. trying to get an email to send.
I get a weird error from swiftmailer:

Fatal error: Uncaught exception 'Swift_TransportException' with message 'Process could not be started [The system cannot find the path specified. ]' in C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php:268 Stack trace: #0 C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php(66): Swift_Transport_StreamBuffer->_establishProcessConnection() #1 C:\xampp\htdocs\lib\classes\Swift\Transport\AbstractSmtpTransport.php(101): Swift_Transport_StreamBuffer->initialize(Array) #2 C:\xampp\htdocs\lib\classes\Swift\Transport\SendmailTransport.php(61): Swift_Transport_AbstractSmtpTransport->start() #3 C:\xampp\htdocs\lib\classes\Swift\Mailer.php(74): Swift_Transport_SendmailTransport->start() #4 C:\xampp\htdocs\Mail.php(20): Swift_Mailer->send(Object(Swift_Message)) #5 {main} thrown in C:\xampp\htdocs\lib\classes\Swift\Transport\StreamBuffer.php on line 268

So I tried a basic mail() script and that doesnt work. I’ve used stunnel and that doesnt seem to work. I’m completely lost. Some direction, a tutorial, anything you can offer please guys!

  • 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-22T23:04:56+00:00Added an answer on May 22, 2026 at 11:04 pm

    On Linux systems, mail is sent from PHP via the mail() function which uses Sendmail. Whenever I use Swiftmailer on windows, I use SMTP, which gmail allows.

    http://www.swiftmailer.org/wikidocs/v3/smtpauth

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

Sidebar

Related Questions

I was always wondering why it is a big deal having version control support
Having been a PHP developer on LAMP servers for quite a while, is there
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having programmed through emacs and vi for years and years at this point, I
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
Having worked with Classic ASP for about 2 years now by creating a few
Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service
Having to upgrade a database schema makes installing a new release of software a
Having a problem getting a TreeView control to display node images. The code below
Having integrated merb_auth_password_slice as per the README, I can successfully login as redirect_after_login is

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.