Maximvdw
Gebruiker
- Lid geworden
- 7 feb 2009
- Berichten
- 921
Hallo,
Ik zit te worstelen met een mail te versturen via een PHP script
Dit zijn mijn gegevens:
-Ik gebruik PHPmailer 5.1
-Ik gebruik PHP 5.1
-OpenSSL staat AAN
-Sockets verbindingen staan aan
Php extensies:
php_sockets
php_openssl
apache:
ssl_module
-Firewall staat af (Om zeker te zijn)
-Ik gebruik WAMPserver 2.2
Dit is mijn code
De error die ik krijg:
SMTP -> ERROR: Failed to connect to server: Er is geprobeerd toegang te verkrijgen tot een socket op een volgens de toegangsmachtigingen niet toegestane manier. (10013)
SMTP Error: Could not connect to SMTP host.
Heb alles al geprobeerd , heb ook al de rollen is omgedraaid (hotmail via ssl://smpt.live.be:25 naar gmail)
maar niets werkt :S..
Kan iemand me aub helpen
Groeten,
Maxim
Ik zit te worstelen met een mail te versturen via een PHP script
Dit zijn mijn gegevens:
-Ik gebruik PHPmailer 5.1
-Ik gebruik PHP 5.1
-OpenSSL staat AAN
-Sockets verbindingen staan aan
Php extensies:
php_sockets
php_openssl
apache:
ssl_module
-Firewall staat af (Om zeker te zijn)
-Ik gebruik WAMPserver 2.2
Dit is mijn code
PHP:
<html>
<head>
<title>PHPMailer - SMTP (Gmail) advanced test</title>
</head>
<body>
<?php
require_once('class.phpmailer.php');
include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "xxxx@gmail.com"; // GMAIL username
$mail->Password = "xxxxxx"; // GMAIL password
$mail->AddReplyTo('xxxxx@gmail.com', 'First Last');
$mail->AddAddress('xxxxx@hotmail.com', 'John Doe');
$mail->SetFrom('xxxxxx@gmail.com', 'First Last');
$mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML(file_get_contents('contents.html'));
$mail->Send();
echo "Message Sent OK</p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
</body>
</html>
SMTP -> ERROR: Failed to connect to server: Er is geprobeerd toegang te verkrijgen tot een socket op een volgens de toegangsmachtigingen niet toegestane manier. (10013)
SMTP Error: Could not connect to SMTP host.
Heb alles al geprobeerd , heb ook al de rollen is omgedraaid (hotmail via ssl://smpt.live.be:25 naar gmail)
maar niets werkt :S..
Kan iemand me aub helpen
Groeten,
Maxim
Laatst bewerkt door een moderator: