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?
Link gekopieerd
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!";
}
?>
Link gekopieerd
Kan je wat meer over die foutmeldingen vertellen?
Link gekopieerd
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!"; }
Link gekopieerd
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)
Link gekopieerd
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.
Link gekopieerd
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
Link gekopieerd
Hoe voer je het script uit? Wat doe je precies?
Link gekopieerd
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
Link gekopieerd
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.
Link gekopieerd