View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Modifications to PHPMailer configuration - ProjeQtOr

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

Modifications to PHPMailer configuration

More
02 Nov 2017 07:38 #1 by eabjoker
I am referencing version 6.4.1
I would like to ask if you can add two settings to the Global_Parameters->Mailing configuration.

The first is to allow the Helo line to be configured and the second is to allow turning off the SMTPSecure setting.
Please see code snippet below from projeqtor.php for the modifications I needed to get this working for my mail smtp server. Line 4 is added, line 12 is commented out
$phpmailer = new PHPMailer ();
  ob_start ();
  if ($logLevel>='3') $phpmailer->SMTPDebug=1;
  $phpmailer->Helo = '['.$_SERVER['SERVER_ADDR'].']';
  $phpmailer->isSMTP (); // Set mailer to use SMTP
  $phpmailer->Host = $paramMailSmtpServer; // Specify main smtp server
  $phpmailer->Port = $paramMailSmtpPort;
  if ($paramMailSmtpUsername and $paramMailSmtpPassword) {
    $phpmailer->SMTPAuth = true; // Enable SMTP authentication
    $phpmailer->Username = $paramMailSmtpUsername; // SMTP username
    $phpmailer->Password = $paramMailSmtpPassword; // SMTP password
#    $phpmailer->SMTPSecure = 'tls'; // default (for ports 25 and 587
    if ($paramMailSmtpPort == '465')
      $phpmailer->SMTPSecure = 'ssl'; // 465 is default for ssl
    if (strpos ( $phpmailer->Host, '://' )!==false) {
      $phpmailer->SMTPSecure = substr ( $phpmailer->Host, 0, strpos ( $phpmailer->Host, '://' ) );
      if ($phpmailer->SMTPSecure=="smtp") $phpmailer->SMTPSecure="";
      $phpmailer->Host = substr ( $phpmailer->Host, strpos ( $phpmailer->Host, '://' ) + 3 );
    }
  }

For the Helo line it should default to the hostname, as it does by default in PHPMailer. I needed to use the IP address here.
SMTPSecure should just be a configuration flag, on/off.

Please Connexion or Create an account to join the conversation.

More
02 Nov 2017 08:50 #2 by babynus
Hi,
I don't understand why you had to configure the Helo :huh:
To change mode, just specify it in host name parameter : ssl://hostname or tls://hostname or smtp://hostname

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
02 Nov 2017 19:04 #3 by eabjoker
I will try smtp://hostname. I was not aware that this would have the same effect.
The Helo line allows the use of a godaddy workspace email account to send email. Godaddy has some rules setup to block outside smtp relay, even if you have valid email account credentials. Setting the client server Helo line as I have here gets around this and allows the connection. The default Helo line provided by PHPMailer is set to serverHostname(), which in my case is not correct, and godaddy rejects the connection. So a way to provide 'Server Hostname' manually is what would be needed.

Please Connexion or Create an account to join the conversation.

More
02 Nov 2017 19:12 #4 by eabjoker
Here is a little more info...
Your HELO/EHLO name should be the system's fully-qualified domain name.
RFC2821
These commands are used to identify the SMTP client to the SMTP server. The argument field contains the fully-qualified domain name of the SMTP client if one is available. In situations in which the SMTP client system does not have a meaningful domain name (e.g., when its address is dynamically allocated and no reverse mapping record is available), the client SHOULD send an address literal (see section 4.1.3), optionally followed by information that will help to identify the client system. The SMTP server identifies itself to the SMTP client in the connection greeting reply and in the response to this command.
(the "address literal" is the address in brackets ([192.0.2.1]), or for v6 the address with an IPv6 prefix ([IPv6:fe80::1]))

Please Connexion or Create an account to join the conversation.

More
09 Nov 2017 22:13 #5 by eabjoker
Follow up, using smtp://hostname seems to have addressed this problem.

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.047 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.