mail opdracht werkt niet
De laatste met subject test 4 gaf rare responses.
Die gaat via server6 naar buiten, de andere via server8.
heb er 2 binnen. test en tst2
Bij gebruik van require_once ('class.phpmailer.php') krijg ik als uitvoer de list van de class.
Met de normale mail functie krijg ik alleen dat hij verzonden is, geen foutmeldingen.
Hieronder de script:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
$message = "Dit is het bericht";
$headers = 'MIME-Version: 1.0' . "\n" .
'Content-type: text/html; charset=UTF-8' . "\n" .
'From: [email protected]' . "\n" .
'Reply-To: [email protected]' . "\n" .
'X-Mailer: PHP/' . phpversion();
if(mail('[email protected]', 'Bericht van mijndomein.nl', $message, $headers))
{
echo 'Mail has been sent';
}
else
{
echo 'Failed sending';
}
echo ' (' . date('H:i:s') . ')';
?>
error_reporting(E_ALL);
ini_set("display_errors", 1);
$message = "Dit is het bericht";
$headers = 'MIME-Version: 1.0' . "\n" .
'Content-type: text/html; charset=UTF-8' . "\n" .
'From: [email protected]' . "\n" .
'Reply-To: [email protected]' . "\n" .
'X-Mailer: PHP/' . phpversion();
if(mail('[email protected]', 'Bericht van mijndomein.nl', $message, $headers))
{
echo 'Mail has been sent';
}
else
{
echo 'Failed sending';
}
echo ' (' . date('H:i:s') . ')';
?>
Wie o wie helpt mij uit deze impasse!!!
Ronald Platje op 28/04/2014 08:52:58:
Even geprobeerd met PHPMailer, maar dat werkt ook niet.
Bij gebruik van require_once ('class.phpmailer.php') krijg ik als uitvoer de list van de class.
Bij gebruik van require_once ('class.phpmailer.php') krijg ik als uitvoer de list van de class.
Leg eens uit?
Bovenstaand scriptje geeft dus na uitvoeren: Mail has been send (met datum/tijd.
Maar aankomen ....... ho maar
Toevoeging op 28/04/2014 09:05:36:
via PHPmailer krijg ik dus als het ware gewoon de listing van de class als uitvoer
Toevoeging op 28/04/2014 09:07:30:
code:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once ('class.phpmailer.php');
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.versatel.nl'; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = *********'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
$mail->From = 'from@example.com';
$mail->FromName = 'Mailer';
$mail->addAddress('info@rplatje.nl'); // Add a recipient
$mail->addAddress('r.platje@versatel.nl'); // Name is optional
$mail->addReplyTo('pla@lekenlinge.nl');
$mail->addCC('');
$mail->addBCC('');
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
?>
require_once ('class.phpmailer.php');
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.versatel.nl'; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = *********'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
$mail->From = 'from@example.com';
$mail->FromName = 'Mailer';
$mail->addAddress('info@rplatje.nl'); // Add a recipient
$mail->addAddress('r.platje@versatel.nl'); // Name is optional
$mail->addReplyTo('pla@lekenlinge.nl');
$mail->addCC('');
$mail->addBCC('');
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
?>
Gewijzigd op 28/04/2014 09:08:52 door Ronald Platje
Wordt er in het geincludeerde bestand wel bovenaan gebruik gemaakt van <?php-tags?
Gewijzigd op 28/04/2014 09:09:37 door - Ariën -
bovenstaand scriptje zie ik niet terug
Toevoeging op 28/04/2014 09:12:40:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer - PHP email creation and transport class.
* @package PHPMailer
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
*/
class PHPMailer
{
[size=xsmall][i]Toevoeging op 28/04/2014 09:12:58:[/i][/size]
enz
[size=xsmall][i]Toevoeging op 28/04/2014 09:13:44:[/i][/size]
dit is de uitvoer
/**
* PHPMailer - PHP email creation and transport class.
* PHP Version 5
* @package PHPMailer
* @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
* @copyright 2012 - 2014 Marcus Bointon
* @copyright 2010 - 2012 Jim Jagielski
* @copyright 2004 - 2009 Andy Prevost
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @note This program is distributed in the hope that it will be useful - WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*/
/**
* PHPMailer - PHP email creation and transport class.
* @package PHPMailer
* @author Marcus Bointon (Synchro/coolbru) <[email protected]>
* @author Jim Jagielski (jimjag) <[email protected]>
* @author Andy Prevost (codeworxtech) <[email protected]>
* @author Brent R. Matzelle (original founder)
*/
class PHPMailer
{
[size=xsmall][i]Toevoeging op 28/04/2014 09:12:58:[/i][/size]
enz
[size=xsmall][i]Toevoeging op 28/04/2014 09:13:44:[/i][/size]
dit is de uitvoer