PHPMailer

PHPMailer

The classic email sending library for PHP

Member Since 8 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
4
repos
Jun
23
9 hours ago
started
started time in 5 minutes ago
push

Synchro push PHPMailer/PHPMailer

Synchro
Synchro

GH Actions: run tests on PRs and show CS violations (#2373)

  • GH Actions: run on PRs and allow for manually triggering

Currently the workflow only ran on push events, which - as forks have to enable the workflows - means that PRs could be submitted without CI having been run and you'd only see the CI results on merge.

By adding the pull_request event, it is ensured that CI is always run within the main repo for pull requests. This also allows for branch protection to be enabled with "required statuses".

Additionally, triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.

This is useful if, for instance, an external action script or composer dependency has broken. Once a fix is available, failing builds for master or open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.

Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

  • GH Actions: report CS violations in the PR

Currently the PR template asks for people to run the CS tooling.

As the PHPCS tool is also run in the test workflow and this workflow - per the previous commit - will now also be run on pull requests, we can make life easier on contributors.

The cs2pr tool allows to display the results from an action run in checkstyle format in-line in the PR code view. This commit enables this for PHPCS, which means that the code view will now show CS violations in the PR.

Ref: https://github.com/staabm/annotate-pull-request-from-checkstyle

Co-authored-by: jrfnl jrfnl@users.noreply.github.com

commit sha: 711de8bf706658afc20443f031a0033b044b764e

push time in 43 minutes ago
pull request

Synchro pull request PHPMailer/PHPMailer

Synchro
Synchro

GH Actions: run tests on PRs and show CS violations

GH Actions: run on PRs and allow for manually triggering

Currently the workflow only ran on push events, which - as forks have to enable the workflows - means that PRs could be submitted without CI having been run and you'd only see the CI results on merge.

By adding the pull_request event, it is ensured that CI is always run within the main repo for pull requests. This also allows for branch protection to be enabled with "required statuses".

Additionally, triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.

This is useful if, for instance, an external action script or composer dependency has broken. Once a fix is available, failing builds for master or open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.

Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

GH Actions: report CS violations in the PR

Currently the PR template asks for people to run the CS tooling.

As the PHPCS tool is also run in the test workflow and this workflow - per the previous commit - will now also be run on pull requests, we can make life easier on contributors.

The cs2pr tool allows to display the results from an action run in checkstyle format in-line in the PR code view. This commit enables this for PHPCS, which means that the code view will now show CS violations in the PR.

Ref: https://github.com/staabm/annotate-pull-request-from-checkstyle

Activity icon
issue

Synchro issue comment PHPMailer/PHPMailer

Synchro
Synchro

Tests: various improvements

This is the first PR in a series of PRs to improve the test suite and make it easier to maintain. The principle of these changes was proposed to and discussed with the maintainer prior to work being started on it.

I'm splitting this up into several PRs to 1) allow for easier review and 2) allow the repo to benefit from the changes as quickly as possible. (the complete series is still a WIP).

Commit details

Tests: remove unused test bootstrap file

The PHPUnit config file requires the vendor/autoload.php file as the test bootstrap and this test/bootstrap.php file is not referenced anywhere in the code base, so this is dead code.

Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix test. For differently named tests, the @test annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with test" convention, this changes the names of the few tests which did not comply with that convention and removes the @test annotations.

Tests: use test skipping where appropriate

In this case, the condition being tested should never be false, so could possibly be removed.

All the same, if the condition would result in a false, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available have been extended hugely over the years. To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to assertEquals() to assertSame(), where assertEquals() does a loose type comparison == and assertSame() does a strict type === comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use assertEquals() - or the PHPUnit 9.4.0 assertObjectEquals() method for comparing value objects using a callback method in the ValueObject class.

Tests: use the correct parameter order

For PHPUnit assertions which expect an $expected and a $result parameter, the parameter order is always ( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is. The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

Tests: use static closures

... when the closure doesn't use $this.

Synchro
Synchro

Thank you so much for all your work on this, really great stuff and much appreciated – and I'm learning a lot too!

push

Synchro push PHPMailer/PHPMailer

Synchro
Synchro

Tests: various improvements (#2372)

  • Tests: remove unused test bootstrap file

The PHPUnit config file requires the vendor/autoload.php file as the test bootstrap and this file is not referenced anywhere in the code base, so this is dead code.

  • Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix test. For differently named tests, the @test annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with test" convention, this changes the names of the few tests which did not comply with that convention and removes the @test annotations.

  • Tests: use test skipping where appropriate

In this case, the condition being tested should never be false, so could possibly be removed.

All the same, if the condition would result in a false, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

  • Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available has been extended hugely over the years. To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to assertEquals() to assertSame(), where assertEquals() does a loose type comparison == and assertSame() does a strict type === comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use assertEquals() - or the PHPUnit 9.4.0 assertObjectEquals() method for comparing value objects using a callback method in the ValueObject class.

  • Tests: use the correct parameter order

For PHPUnit assertions which expect an $expected and a $result parameter, the parameter order is always `( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is. The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

  • Tests: use static closures

... when the closure doesn't use $this.

Co-authored-by: jrfnl jrfnl@users.noreply.github.com

commit sha: c33a304650e62ff3dfec65652a68c3262d915566

push time in 45 minutes ago
pull request

Synchro pull request PHPMailer/PHPMailer

Synchro
Synchro

Tests: various improvements

This is the first PR in a series of PRs to improve the test suite and make it easier to maintain. The principle of these changes was proposed to and discussed with the maintainer prior to work being started on it.

I'm splitting this up into several PRs to 1) allow for easier review and 2) allow the repo to benefit from the changes as quickly as possible. (the complete series is still a WIP).

Commit details

Tests: remove unused test bootstrap file

The PHPUnit config file requires the vendor/autoload.php file as the test bootstrap and this test/bootstrap.php file is not referenced anywhere in the code base, so this is dead code.

Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix test. For differently named tests, the @test annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with test" convention, this changes the names of the few tests which did not comply with that convention and removes the @test annotations.

Tests: use test skipping where appropriate

In this case, the condition being tested should never be false, so could possibly be removed.

All the same, if the condition would result in a false, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available have been extended hugely over the years. To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to assertEquals() to assertSame(), where assertEquals() does a loose type comparison == and assertSame() does a strict type === comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use assertEquals() - or the PHPUnit 9.4.0 assertObjectEquals() method for comparing value objects using a callback method in the ValueObject class.

Tests: use the correct parameter order

For PHPUnit assertions which expect an $expected and a $result parameter, the parameter order is always ( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is. The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

Tests: use static closures

... when the closure doesn't use $this.

push

Synchro push PHPMailer/PHPMailer

Synchro
Synchro

GH Actions: don't run the docs workflow on forks (#2371)

The docs workflow to deploy the GH Pages website is run on pushes to master, but that includes pushes to master in forks, which obviously can't deploy to the GH Pages site.

This means that in forks (and there are nearly 9000 of them), this workflow will always fail, while in reality, it shouldn't be run in the first place.

So, I'd like to propose making this small change, which should prevent the docs workflow from being run on forks.

Co-authored-by: jrfnl jrfnl@users.noreply.github.com

commit sha: 8eacfe7925cda71bbc5b5820ba91a5b200e7b394

push time in 46 minutes ago
pull request

Synchro pull request PHPMailer/PHPMailer

Synchro
Synchro

GH Actions: don't run the docs workflow on forks

The docs workflow to deploy the GH Pages website is run on pushes to master, but that includes pushes to master in forks, which obviously can't deploy to the GH Pages site.

This means that in forks (and there are nearly 9000 of them), this workflow will always fail, while in reality, it shouldn't be run in the first place.

So, I'd like to propose making this small change, which should prevent the docs workflow from being run on forks.

push

Synchro push PHPMailer/PHPMailer

Synchro
Synchro

.gitattributes: sync with reality (#2374)

The .gitattributes file was no longer in line with the files in the repo. Fixed now.

Co-authored-by: jrfnl jrfnl@users.noreply.github.com

commit sha: 702502aca2ec7489b4758245517d6cb6ba243085

push time in 46 minutes ago
pull request

Synchro pull request PHPMailer/PHPMailer

Synchro
Synchro

.gitattributes: sync with reality

The .gitattributes file was no longer in line with the files in the repo. Fixed now.

Activity icon
issue

Synchro issue comment PHPMailer/PHPMailer

Synchro
Synchro

email sent but not to gmail

Hello,

I have a problem using PHPMailer 6.5.0 Sending email result is ok, and some of recipients can received email, but not gmail email address. Can anyone check and please help me to solve the problem?

//Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP;

require 'includes/PHPMailer.php'; require 'includes/SMTP.php';

//Create a new PHPMailer instance $mail = new PHPMailer(); //Set PHPMailer to use the sendmail transport

$mail->isSMTP(); $mail->Host = 'emailserver'; $mail->Port = 465; $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = 'username'; $mail->Password = '123'; $mail->isSendmail(); $mail->isHTML(true); $mail->SMTPDebug = 2; $mail->setFrom('me@test.com', 'example'); $mail->addReplyTo('me@test.com', 'example');

$subject="this is just email"; $strhtml="Hello";

$mail->addAddress('whateveremail@gmail.com','Example'); $mail->Subject = $subject; $mail->msgHTML($strhtml); $mail->send();

Regards,

Andry

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

Code to reproduce

Debug output

Synchro
Synchro

I just spotted that you have an isSendmail() call in there. Why do you have that? With that it means that it is ignoring all your SMTP settings and will not be sending through your chosen server. I recommend deleting that line as it's very unlikely to be what you need.

Activity icon
issue

Synchro issue comment PHPMailer/PHPMailer

Synchro
Synchro

email sent but not to gmail

Hello,

I have a problem using PHPMailer 6.5.0 Sending email result is ok, and some of recipients can received email, but not gmail email address. Can anyone check and please help me to solve the problem?

//Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP;

require 'includes/PHPMailer.php'; require 'includes/SMTP.php';

//Create a new PHPMailer instance $mail = new PHPMailer(); //Set PHPMailer to use the sendmail transport

$mail->isSMTP(); $mail->Host = 'emailserver'; $mail->Port = 465; $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = 'username'; $mail->Password = '123'; $mail->isSendmail(); $mail->isHTML(true); $mail->SMTPDebug = 2; $mail->setFrom('me@test.com', 'example'); $mail->addReplyTo('me@test.com', 'example');

$subject="this is just email"; $strhtml="Hello";

$mail->addAddress('whateveremail@gmail.com','Example'); $mail->Subject = $subject; $mail->msgHTML($strhtml); $mail->send();

Regards,

Andry

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

Code to reproduce

Debug output

Synchro
Synchro

Have you checked spam folders on gmail? If you have access to your mail server's log files, that will tell you what happened to those messages.

Activity icon
issue

XL-2000 issue comment PHPMailer/PHPMailer

XL-2000
XL-2000

email sent but not to gmail

Hello,

I have a problem using PHPMailer 6.5.0 Sending email result is ok, and some of recipients can received email, but not gmail email address. Can anyone check and please help me to solve the problem?

//Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP;

require 'includes/PHPMailer.php'; require 'includes/SMTP.php';

//Create a new PHPMailer instance $mail = new PHPMailer(); //Set PHPMailer to use the sendmail transport

$mail->isSMTP(); $mail->Host = 'emailserver'; $mail->Port = 465; $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = 'username'; $mail->Password = '123'; $mail->isSendmail(); $mail->isHTML(true); $mail->SMTPDebug = 2; $mail->setFrom('me@test.com', 'example'); $mail->addReplyTo('me@test.com', 'example');

$subject="this is just email"; $strhtml="Hello";

$mail->addAddress('whateveremail@gmail.com','Example'); $mail->Subject = $subject; $mail->msgHTML($strhtml); $mail->send();

Regards,

Andry

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

Code to reproduce

Debug output

XL-2000
XL-2000

I ran some quick tests on 6.5.0 an all works fine with gmail. I guess, but can only guess, the sending server or email itself might not be acceptable for gmail

started
started time in 1 hour ago
Activity icon
issue

andryfixa issue PHPMailer/PHPMailer

andryfixa
andryfixa

email sent but not to gmail

Hello,

I have a problem using PHPMailer 6.5.0 Sending email result is ok, and some of recipients can received email, but not gmail email address. Can anyone check and please help me to solve the problem?

//Import the PHPMailer class into the global namespace use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP;

require 'includes/PHPMailer.php'; require 'includes/SMTP.php';

//Create a new PHPMailer instance $mail = new PHPMailer(); //Set PHPMailer to use the sendmail transport

$mail->isSMTP(); $mail->Host = 'emailserver'; $mail->Port = 465; $mail->SMTPSecure = 'ssl'; $mail->SMTPAuth = true; $mail->Username = 'username'; $mail->Password = '123'; $mail->isSendmail(); $mail->isHTML(true); $mail->SMTPDebug = 2; $mail->setFrom('me@test.com', 'example'); $mail->addReplyTo('me@test.com', 'example');

$subject="this is just email"; $strhtml="Hello";

$mail->addAddress('whateveremail@gmail.com','Example'); $mail->Subject = $subject; $mail->msgHTML($strhtml); $mail->send();

Regards,

Andry

Please check these things before submitting your issue:

  • Read the error message you're seeing - it often tells you what is wrong, and may contain useful links & instructions
  • Make sure you're using the latest version of PHPMailer
  • Check that your problem is not dealt with in the troubleshooting guide, especially if you're having problems connecting to Gmail or GoDaddy
  • Include sufficient code to reproduce your problem
  • If you're having an SMTP issue, include the debug output generated with SMTPDebug = 2 set
  • If you have a question about how to use PHPMailer (rather than reporting a bug in it), tag a question on Stack Overflow with phpmailer, but search first!

Problem description

Code to reproduce

Debug output

Activity icon
fork

arsenal1447 forked PHPMailer/PHPMailer

⚡ The classic email sending library for PHP
arsenal1447 GNU Lesser General Public License v2.1 Updated
fork time in 7 hours ago
pull request

jrfnl pull request PHPMailer/PHPMailer

jrfnl
jrfnl

.gitattributes: sync with reality

The .gitattributes file was no longer in line with the files in the repo. Fixed now.

started
started time in 8 hours ago
pull request

jrfnl pull request PHPMailer/PHPMailer

jrfnl
jrfnl

GH Actions: run tests on PRs and show CS violations

GH Actions: run on PRs and allow for manually triggering

Currently the workflow only ran on push events, which - as forks have to enable the workflows - means that PRs could be submitted without CI having been run and you'd only see the CI results on merge.

By adding the pull_request event, it is ensured that CI is always run within the main repo for pull requests. This also allows for branch protection to be enabled with "required statuses".

Additionally, triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.

This is useful if, for instance, an external action script or composer dependency has broken. Once a fix is available, failing builds for master or open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.

Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

GH Actions: report CS violations in the PR

Currently the PR template asks for people to run the CS tooling.

As the PHPCS tool is also run in the test workflow and this workflow - per the previous commit - will now also be run on pull requests, we can make life easier on contributors.

The cs2pr tool allows to display the results from an action run in checkstyle format in-line in the PR code view. This commit enables this for PHPCS, which means that the code view will now show CS violations in the PR.

Ref: https://github.com/staabm/annotate-pull-request-from-checkstyle

pull request

jrfnl pull request PHPMailer/PHPMailer

jrfnl
jrfnl

Tests: various improvements

This is the first PR in a series of PRs to improve the test suite and make it easier to maintain. The principle of these changes was proposed to and discussed with the maintainer prior to work being started on it.

I'm splitting this up into several PRs to 1) allow for easier review and 2) allow the repo to benefit from the changes as quickly as possible. (the complete series is still a WIP).

Commit details

Tests: remove unused test bootstrap file

The PHPUnit config file requires the vendor/autoload.php file as the test bootstrap and this test/bootstrap.php file is not referenced anywhere in the code base, so this is dead code.

Tests: apply test method naming conventions

For tests to be picked up by PHPUnit automatically, the method should start with the prefix test. For differently named tests, the @test annotation can be used to still mark a method as a test and get PHPUnit to run it.

As the vast majority of tests use the "prefix the method with test" convention, this changes the names of the few tests which did not comply with that convention and removes the @test annotations.

Tests: use test skipping where appropriate

In this case, the condition being tested should never be false, so could possibly be removed.

All the same, if the condition would result in a false, the test would be marked as "risky" as no assertions would be run by it.

This can be avoided by using the condition to set a test skip annotation, instead of wrapping the actual test code in the condition.

Tests: use strict assertions

PHPUnit contains a variety of assertions and the ones available have been extended hugely over the years. To have the most reliable tests, the most specific assertion should be used.

Most notably, this changes calls to assertEquals() to assertSame(), where assertEquals() does a loose type comparison == and assertSame() does a strict type === comparison.

The only real exception to this is when comparing two objects, as in that case, the objectID will not be the same, so those should still use assertEquals() - or the PHPUnit 9.4.0 assertObjectEquals() method for comparing value objects using a callback method in the ValueObject class.

Tests: use the correct parameter order

For PHPUnit assertions which expect an $expected and a $result parameter, the parameter order is always ( $expected, $result, ...).

While it may not seem important to use the correct parameter order for assertions doing a straight comparison, in actual fact, it is. The PHPUnit output when the assertions fail expects this order and the failure message will be reversed if the parameters are passed in reversed order which leads to confusion and makes it more difficult to debug a failing test.

Tests: use static closures

... when the closure doesn't use $this.

pull request

jrfnl pull request PHPMailer/PHPMailer

jrfnl
jrfnl

GH Actions: don't run the docs workflow on forks

The docs workflow to deploy the GH Pages website is run on pushes to master, but that includes pushes to master in forks, which obviously can't deploy to the GH Pages site.

This means that in forks (and there are nearly 9000 of them), this workflow will always fail, while in reality, it shouldn't be run in the first place.

So, I'd like to propose making this small change, which should prevent the docs workflow from being run on forks.

Before submitting your pull request, check whether your code adheres to PHPMailer coding standards (which is mostly PSR-12) by running PHP CodeSniffer:

./vendor/bin/phpcs

Any problems reported can probably be fixed automatically by using its partner tool, PHP code beautifier:

./vendor/bin/phpcbf
Jun
22
1 day ago
Activity icon
fork

onisciencia42 forked PHPMailer/PHPMailer

⚡ The classic email sending library for PHP
onisciencia42 GNU Lesser General Public License v2.1 Updated
fork time in 12 hours ago
started
started time in 12 hours ago
Activity icon
fork

utpalendubarman forked PHPMailer/PHPMailer

⚡ The classic email sending library for PHP
utpalendubarman GNU Lesser General Public License v2.1 Updated
fork time in 14 hours ago
Activity icon
issue

Synchro issue PHPMailer/PHPMailer

Synchro
Synchro

SMTP connect() fail from crontab

I have a php script that runs nightly via cron.

I can run the script from a browser and it functions perfectly, but when run from cron, it throws SMTP connect() fail.

require '../vendor/phpmailer/phpmailer/PHPMailerAutoload.php'; $mail = new PHPMailer; // $mail->SMTPDebug = 4;
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->isSMTP();
$mail->Host = 'localhost';
$mail->SMTPAuth = true;
$mail->Username = '@mail->Password = '';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('
@Support'); $mail->isHTML(true);
$body.="

Cron: util.test.cron.php is running

"; $mail->Subject="CRON Test!"; $mail->Body=$body; $mail->addAddress('**@gmail.com', '*****'); $mail->send(); $mail->ClearAddresses();

I'm pretty tapped out on ideas to try, so any help would be appreciated.

Activity icon
issue

Synchro issue PHPMailer/PHPMailer

Synchro
Synchro

SMTP ERROR: Failed to connect to server: Conexión rehusada (111) in Phplist

Hello try send emails with phplist by

<?php define('PHPMAILERHOST', 'smtp.server.com:587'); $phpmailer_smtpuser = 'USER'; $phpmailer_smtppassword = 'PASSWORD'; define("PHPMAILER_SECURE",'tls');

and add the smtpOptions

SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true));

the result is this.

2021-03-22 23:39:19 Connection: opening to smtp1.s.server.com:587, timeout=5, options=array ( 'ssl' => array ( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true, ),) 2021-03-22 23:39:20 Connection failed. Error #2: stream_socket_client(): unable to connect to smtp1.s.server.com:587 (Conexión rehusada) [/home/xxxx/public_html/xxxx/lists/admin/PHPMailer6/src/SMTP.php line 375] 2021-03-22 23:39:20 SMTP ERROR: Failed to connect to server: Conexión rehusada (111) SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

I don't know whats is the problem, help me please.

best regards Kibalam