| View previous topic :: View next topic |
| Author |
Message |
Scout
Joined: 18 Sep 2007 Posts: 21 Location: Germany
|
Posted: Wed Sep 19, 2007 1:52 pm Post subject: Authentifizierungstyp zum Mailserver angeben? |
|
|
Hallo XPertMailer Team,
Ich habe mich dazu entschlossen die Mail-Klasse zu verwenden mit der Direktverbindung zum Mailserver per tls/ssl.
D.h. ich instanziere die Mail-Klasse, setze Mail Adresse & Text, mach ein Connect() zum Mailserver und übergeb der Send()-Fkt. die Connection-Resource.
Leider fehlt mir irgendwie die Möglichkeit bei der Connect()-Funktion den Authentifizierungstyp anzugeben.
Habe dann mal in die SMTP5::Connect()-Fkt. geschaut und festgestellt, dass dort ein $auth['default'] abgefragt werden könnte, dieser allerdings mit "$auth['default'] = $auth['login'] = $auth['plain'] = $auth['cram-md5'] = false;" zwangsweise auf FALSE gesetzt wird.
Wie kann man einen Default-Authentifizierungstyp (z.B. cram-md5) angeben?
Grüßle Scout |
|
| Back to top |
|
 |
admin Site Admin
Joined: 14 Aug 2007 Posts: 136
|
|
| Back to top |
|
 |
Scout
Joined: 18 Sep 2007 Posts: 21 Location: Germany
|
Posted: Thu Sep 20, 2007 11:09 am Post subject: |
|
|
I have this constellation:
| Code: |
<?php
define('DISPLAY_XPM4_ERRORS', true); // display XPM4 errors
require_once 'mail402/MAIL.php';
mb_internal_encoding("utf-8");
$m = new MAIL;
$m->From('sender@domain.de', 'Sender', 'UTF-8');
$m->AddTo('rcpt@domain.de', 'Recipient', 'UTF-8');
$m->Subject('Testmail', 'UTF-8');
$m->text('bodytext inside the mail', 'UTF-8');
$c = $m->Connect('mail.mailserverdomain.de', 465, 'username', 'password', 'tls') or die(print_r($m->Result));
echo $m->Send($c) ? 'Mail sent !' : 'Error !';
$m->Disconnect();
?>
|
Sorry, but I think it´s impossible to set the authentication without doing the authentication step-by-step via stream_socket.
Is it possible to enlarge the connect() function with $type-argument and you loop through it to the auth() function?
Regards Scout |
|
| Back to top |
|
 |
admin Site Admin
Joined: 14 Aug 2007 Posts: 136
|
Posted: Thu Sep 20, 2007 1:56 pm Post subject: |
|
|
| Yes, i will do this, for SMTP::Connect() and MAIL->Connect(). This feature will be available in the next release of XPM4 (v.0.3). Now i prepare to launch this new release. |
|
| Back to top |
|
 |
Scout
Joined: 18 Sep 2007 Posts: 21 Location: Germany
|
Posted: Sun Sep 23, 2007 11:02 am Post subject: |
|
|
Alternatively make a new funktion setAuth() like the priority-funktion. Thise have the advantage to have a backwards compatibility.  |
|
| Back to top |
|
 |
admin Site Admin
Joined: 14 Aug 2007 Posts: 136
|
Posted: Tue Sep 25, 2007 1:13 pm Post subject: |
|
|
In Mail Class you can set the global value for authentication method by using the deprecated method:
| Code: | $m = new MAIL;
$m->Auth = 'cram-md5'; | You need to run XPM4 v.0.3 or greater. |
|
| Back to top |
|
 |
|