Skip to content

Php‐Mailer

gtbu edited this page Jun 26, 2024 · 32 revisions
  • Typesetter 5.2 uses Phpmailer 5.2.7.
  • Typesetter 5.5 p8.3 has now phpmailer 6.9.1 :

The configuration has 4 main - parameters and can be tricky (several fields):

SMTP-Contact

Standard contact form

  1. The standard after Typesetter-setup is the integrated php-mail ([email protected]) for which only the email of the administrator is necessary. If You use it, then You must remove the hook which is active in the above picture : **The hook is necessary if You use SMTP, because otherwise the [email protected] will be send and the smtp-server rejects the mail. ** For php-mail You should remove the hook.

  1. Sendmail https://tecadmin.net/install-sendmail-on-ubuntu/ is very old and no more the standard. You should check if it is installed in Your linux-server. (In phpmailer.php line 222 : public $Sendmail = '/usr/sbin/sendmail'; stands the standard path; in Emailer.php line 190 : function Sendmail_Path() with the default path '/usr/sbin/sendmail'; ) Many systems install alternatives like ''postfix''.

  1. Alternatives use the https://de.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol (disadvantage : the mail-password of the provider is stored in Typesetter; advantage : The mail can be send encryted with TLS)
  • For smtp and smtp-auth : Please do not forget to set the hook into the standard contact-form:

The sender is now Your email-address like : [email protected] (or as above : [email protected] ) and beyond Your.user (instead of [email protected] and AutomatedSender ) - please change it and save !

In the top - form (advanced) choose smtp and fill in the parameters of Your provider as in the examples.

......................................................................................

a : Google has smtp.gmail.com" (Port 465 or 587) --- SSL (Port 465) and TLS and STARTTLS (Port 587)

b : Microsoft : SMTP AUTH client submission endpoint smtp.office365.com ; SMTP port 587 , SMTP encryption STARTTLS (also : smtp-mail.outlook.com )

  • Some SMTP servers forbid connections from "outsiders". Some SMTP servers do not support SSL (or TLS) connections.

  • BUT there is one new problem : Many email - providers use now Oauth2 (with second key send by Sms) , and for them a oauth2-client is often necessary(a phpmailer-feature for which the installation of special apis would be necessary).

Therefore You will have to use a email-provider without this feature, in the most simple case an email account of Your website-provider.

Some firewalls of shared hosting - providers may block the connection to the external email-provider and allow SMTP first with higher paid accounts.


Emailer.php

In line 32 the code is : case 'smtpauth':
$this->SMTPAuth = true;
$this->Username = \gp\tool::ConfigValue('smtp_user','');
$this->Password = \gp\tool::ConfigValue('smtp_pass','');
case 'smtp';
$this->IsSMTP();
In configuration.php are actual parameters .
Line 32 ......
'mail_method' => '',
'sendmail_path' => '',
'smtp_hosts' => '',
'smtp_user' => '',
'smtp_pass'

If You want to see details of the protocol , You can add $this->SMTPDebug = 2; ( or 3 ) behind line 26 or 27


(will be continued with pictures etc. for phpmailer 6.91 (which is in test with several providers)

Clone this wiki locally