Nou beste mensen op deze forum.

heb in middels php mailer 5.6.0 op me webserver staan.
en heb ik php.ini extension ssl geactiveerd.

Maar hoe moet deze verder ingesteld worden. en hoe kan ik zien dat het werkt.

Wie zou me daar mee kunnen helpen via team view. kijken is al genoeg.
als ik maar weet wat er verkeerd is. kom er niet verder mee.
bedoeling is een formmail naar mijn gmail account

en wat voor formmail.php heb ik nodig.

gebruik dit wampserver 2.5
Apache/2.4.9 (Win32) PHP/5.5.12 Server at nederland.serverthuis.nl Port 80
Laten we het i.p.v. teamviewer maar op het forum houden. Dan kunnen anderen ook nog meekijken.
Heb je al iets aan relevante code wat we kunnen zien?
heb wel een en ander gevonden op internet google. maar op een of ander manier verzend die niet en heb ik alleen maar fout meldingen in me php.

zo als dit

<?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();

$body             = file_get_contents('contents.html');
$body             = eregi_replace("[\]",'',$body);

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "mail.yourdomain.com"; // SMTP server
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->Host       = "mail.yourdomain.com"; // sets the SMTP server
$mail->Port       = 26;                    // set the SMTP port for the GMAIL server
$mail->Username   = "yourname@yourdomain"; // SMTP account username
$mail->Password   = "yourpassword";        // SMTP account password

$mail->SetFrom('[email protected]', 'First Last');

$mail->AddReplyTo("[email protected]","First Last");

$mail->Subject    = "PHPMailer Test Subject via smtp, basic with authentication";

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test

$mail->MsgHTML($body);

$address = "[email protected]";
$mail->AddAddress($address, "John Doe");

$mail->AddAttachment("images/phpmailer.gif");      // attachment
$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
    ?>

Kan je wat meer over die foutmeldingen vertellen?
require_once('PHPMailer/class.phpmailer.php'); //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded $mail = new PHPMailer(); $body = file_get_contents('contents.html'); $body = eregi_replace("[\]",'',$body); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "smtp.gmail.com"; // SMTP server $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "smtp.gmail.com"; // sets the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server $mail->Username = "[email protected]"; // SMTP account username $mail->Password = "......"; // SMTP account password $mail->SetFrom('[email protected]', 'First Last'); $mail->AddReplyTo("[email protected]","First Last"); $mail->Subject = "Account server"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "[email protected]"; $mail->AddAddress($address, "John Doe"); $mail->AddAttachment("images/phpmailer.gif"); // attachment $mail->AddAttachment("images/phpmailer_mini.gif"); // attachment if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; }
Dat is de code, en niet de foutmelding.

Als je dit letterlijk ziet dan:
- Heb je geen <?php en ?> om je code heen staan
- Heeft het bestand waar het in staat geen .php -extentie
- Voer je het uit via je browser via een pad op je eigen schijf, zoals file://C:\whatever\nogiets\script.php
- Ondersteund de webserver geen PHP (kleine kans)
Je hebt je SMTP class waarschijnlijk ook nodig.

Zoals PHPMailer zelf aangeeft is het het makkelijkste om van hun eigen autoloader gebruik te maken.

Een minimale set bestanden die je dan nodig hebt om PHPMailer te kunnen gebruiken is:
class.phpmailer.php
class.smtp.php
PHPMailerAutoload.php

Het enige wat je hoeft te requiren is PHPMailerAutoload.php - PHPMailer regelt zelf de rest.
staat op de server en online.
opgeslagen als .php extensie.

of is er een makkelijke script.
heb wel als je op verzend drukt. POST - formmail.php
Hoe voer je het script uit? Wat doe je precies?
in formulie account aanvragen.

staat die als.

<p align="center"><input type="submit" value="Verzenden" name="zend"><input type="reset" value="Wissen" name="wis"></p>
<input type="hidden" name="recipient" value="[email protected]">
<input type="hidden" name="redirect" value="http://nederland.serverthuis.nl">
<input type="hidden" name="subject" value="Account_server">

dan als post - formmail.php daar staat dan script in wat class.phpmailer.php oproept
maar, dat is mijn vraag niet. Ik vraag me af hoe je het script uitvoert. In je formulier zie ik niks staan wat verwijst naar je formmail.php.

Verder zijn die hidden inputs nergens voor nodig.

Reageren