**If, when using the sc\_mail\_send macro in a Linux or MAC environment, the following error occurs:**

Fatal error: Uncaught Swift\_TransportException: Connection could not be established with host smtp.gmail.com [ #0] in /opt/Scriptcase/v9-php81/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/StreamBuffer.php:269 Stack trace: #0 /opt/Scriptcase/v9-php81/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/StreamBuffer.php(62): Swift\_Transport\_StreamBuffer->\_establishSocketConnection() #1 /opt/Scriptcase/v9-php81/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/AbstractSmtpTransport.php(113): Swift\_Transport\_StreamBuffer->initialize(Array) #2 /opt/Scriptcase/v9-php81/wwwroot/scriptcase/prod/third/swift/classes/Swift/Mailer.php(79): Swift\_Transport\_AbstractSmtpTransport->start() #3 /opt/Scriptcase/v9-php81/wwwroot/scriptcase/app/teste\_mantis/blank/index.php(2425): Swift\_Mailer->send(Object(Swift\_Message), Array) #4 /opt/Scriptcase/v9-php81/wwwroot/scriptcase/app/teste\_mantis/blank/index.php(2793): blank\_apl->controle() #5 {main} thrown in /opt/Scriptcase/v9-php81/wwwroot/scriptcase/prod/third/swift/classes/Swift/Transport/StreamBuffer.php on line 269

It will be necessary to follow the steps below to correct the error:

**1º - Locate the php.ini file that is in the root directory:**

- **Linux :** /opt/Scriptcase/v9-php81/components/php

- **MAC :** /Applications/Scriptcase/v9-php81/components/php/

![](https://help.scriptcase.net/galleryDocuments/edbsn13c4cccf4c95c93070d2daed5c7170322e1e73e3ae58d1f77ae9d3d7a81def54be769aacd67dc6a0b983c6e7590643c5?inline=true)

**2º - After locating the php.ini file, access it.**

- Afterward, perform a search for lines 1932 and 1940 and insert the following values:

**LINUX**

**in the line 1932 :** curl.cainfo = "/opt/Scriptcase/v9-php81/components/php/etc/curl-ca-bundle.crt"

**in the line 1940 :** openssl.cafile="/opt/Scriptcase/v9-php81/components/php/etc/curl-ca-bundle.crt"

**MAC**  
**in the line 1932 :** curl.cainfo = "/Applications/Scriptcase/v9-php81/components/php/etc/curl-ca-bundle.crt"  
**in the line 1940 :** openssl.cafile = "/Applications/Scriptcase/v9-php81/components/php/etc/curl-ca-bundle.crt"

As shown in the image below

![](https://help.scriptcase.net/galleryDocuments/edbsn6bfb96cffec36614f22e8d5a539bbe2fd7c4cd9632ad3802b8937636ca0d67f72c27a5536ce4a2101e4dd368475f39bd?inline=true)

**3º - After making changes to the php.ini file, save the changes and restart the Apache service for Scriptcase.**

**LINUX**

### /opt/Scriptcase/v9-php81/components/apache/sc\_apache restart

**Mac**

### /Applications/Scriptcase/v9-php81/components/apache/sc\_apache restart

###

After restarting, attempt to send the email again in the application using the sc\_send\_mail macro. This time, the email will be sent without errors.