For issues related to the current stable release please use it's own Help forum.
IMPORTANT:Please read this before using an git or nightly build version: wiki.webtrees.net/en/GIT

Before asking for help please read "How to request help" by clicking on that tab above here.

TOPIC: Problem sending Mails by SMTP

Problem sending Mails by SMTP 2 months 5 days ago #1

  • hlein
  • hlein's Avatar
  • Offline
  • Junior
  • Posts: 138
Hi,

I tested SMTP with this script:
<?php

namespace Fisharebest\Webtrees;

use Middleland\Dispatcher;

require __DIR__ . '/vendor/autoload.php';

// require './vendor/swiftmailer/swiftmailer/lib/swift_required.php';

use Swift_Mailer;
use Swift_MailTransport;
use Swift_Message;
use Swift_NullTransport;
use Swift_Preferences;
use Swift_SendmailTransport;
use Swift_SmtpTransport;
use Swift_Transport;



$pEmailGmail = 'xxxxxx@gmail.com';
$pPasswordGmail = 'xxxxxx;
$pFromName = 'MundialSYS.com'; //display name

$pTo = 'hlein@gmx.at'; //destination email
$pSubjetc = "Hello MundialSYS"; //the subjetc 
$pBody = '<html><body><p>Hello MundialSYS</p></html></body>'; //body html

$transport = new Swift_SmtpTransport/*::newInstance*/('smtp.gmail.com', 465, 'ssl');
            $transport->setUsername($pEmailGmail);
            $transport->setPassword($pPasswordGmail);

$mMailer = new Swift_Mailer/*::newInstance*/($transport);

$mEmail = new Swift_Message/*::newInstance()*/;
$mEmail->setSubject($pSubjetc);
$mEmail->setTo($pTo);
$mEmail->setFrom(array($pEmailGmail => $pFromName));
$mEmail->setBody($pBody, 'text/html'); //body html

if($mMailer->send($mEmail) == 1){
    echo 'send ok';
}
else {
    echo 'send error';
}
?>

It did send mails.

I configured webtrees to do the same, but it does not work. The site settings (exported to CSV) are:
"ALLOW_CHANGE_GEDCOM","1"
"ALLOW_USER_THEMES","1"
"DEFAULT_COLOR_PALETTE","ash"
"FV_SCHEMA_VERSION","4"
"glide-key","521bdf532288617bd61b431a0fb05a2c50623b0cb1d2b4f3b6efa381e38290125f06385dd938b54d6c99f02af11851a7934c728edffcc24876a887eaff7c840fc75037c5392af378f17c3ecb1022c0f81d1e99b1d8f917f81ea8b4fff0816ff569d8f2772b8134c58932132468f54722acd6690b4a288899941f4de7fe02f6b7"
"GM_SCHEMA_VERSION","6"
"INDEX_DIRECTORY","data/"
"LAST_CHANGE_EMAIL","1517680900"
"LATEST_WT_VERSION","2.0.0-beta.2|1.0.0|https://github.com/fisharebest/webtrees/releases/download/2.0.0-beta.2/webtrees-2.0.0-beta.2.zip"
"LATEST_WT_VERSION_TIMESTAMP","1557767143"
"NB_SCHEMA_VERSION","3"
"next_xref","49"
"SESSION_TIME","7200"
"SMTP_ACTIVE","external"
"SMTP_AUTH","1"
"SMTP_AUTH_PASS","xxxxxxx"
"SMTP_AUTH_USER","xxxxxx@gmail.com"
"SMTP_FROM_NAME","xxxxxx@gmail.com"
"SMTP_HELO","gmail.com"
"SMTP_HOST","smtp.gmail.com"
"SMTP_PORT","465"
"SMTP_SSL","ssl"
"THEME_DIR","colors"
"TIMEZONE","UTC"
"USE_REGISTRATION_MODULE","1"
"WT_SCHEMA_VERSION","43"

The mail is entered into the message panel, but not sent out.
Regards
Helmut
The administrator has disabled public write access.

Problem sending Mails by SMTP 2 months 5 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Online
  • Administrator
  • Posts: 11160
> "SMTP_HELO","gmail.com"

This is the setting "Sending server name".

It should be the name of *your* server.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Problem sending Mails by SMTP 2 months 4 days ago #3

  • hlein
  • hlein's Avatar
  • Offline
  • Junior
  • Posts: 138
Hi,

I don't think so. Because of two reasons:
1) I did not specify this anywhere in the test script
2) in case of trying to send with webtrees it seems that webtress does not even try to send. In a line trace of virtualbox there is no indication that it asks DNS for the address of gmail.com (which is in contrast to 1) where I can see the DNS request and some HELO handshake - further data encrypted)
Regards
Helmut
The administrator has disabled public write access.

Problem sending Mails by SMTP 2 months 4 days ago #4

  • hlein
  • hlein's Avatar
  • Offline
  • Junior
  • Posts: 138
It seems I made it run on my Virtualbox Test server.

It seems to have been a configuration error - in the My Account page the contact method was default (internal). By specifying internal messages with emails it seems to work now.

I will come back after I findmore information what happens at my official homepage.
Regards
Helmut
The administrator has disabled public write access.
Powered by Kunena Forum