2016-07-10 9 views
-3
this is my code: 
<?php 
functionrequire 'zMovie/phpmailer/PHPMailerAutoload.php'; 

$mail = new PHPMailer; 

$mail->isSMTP();          // Set mailer to use SMTP 
$mail->Host = 'smtp.live.com'; // Specify main and backup SMTP servers 
$mail->SMTPAuth = true;        // Enable SMTP authentication 
$mail->Username = '[email protected]';     // SMTP username 
$mail->Password = 'Teresapaula1';       // SMTP password 
$mail->SMTPSecure = 'tls';       // Enable TLS encryption, `ssl` also accepted 
$mail->Port = 587;         // TCP port to connect to 

$mail->setFrom('[email protected]', 'Mailer'); 
$mail->addAddress('[email protected]', 'Fernando Alves');  // Add a recipient 
$mail->addAddress('[email protected]');    // Name is optional 
$mail->addReplyTo('[email protected]', 'Information'); 
$mail->addCC('[email protected]'); 
$mail->addBCC('[email protected]'); 

$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; 
} 
else { 
    echo 'Message has been sent'; 
} 

Im PHP-Mailer mit meiner Form senden und E-Mail Throught aber, dass Fehler meiner nerves.im 1 Tag pushen dieses Projekt zu beenden und ich nicht lösen kann dies !! Er sagte auch, dass der Fehler in Zeile 2 "functionrequire 'zMovie/phpmailer/PHPMailerAutoload.php';". Wenn Sie alle mir helfen könnten, wäre ich Mutch Dankbar !! :)T_CONSTANT_ENCAPSED_STRING

+1

Was zum Teufel ist 'functionrequire'? – tkausl

+0

Funktion aus Funktionsanforderung entfernen 'zMovie/phpmailer/PHPMailerAutoload.php'; – Satya

+0

aber wenn ich Funktion entferne, gibt es dieses "Warnung: erfordern (zMovie/phpmailer/PHPMailerAutoload.php) [function.require]: konnte Strom nicht öffnen: Keine solche Datei oder Verzeichnis in C: \ Benutzer \ Nazista \ Desktop \ soft \ www \ zMovie \ contact.php on line 2 Schwerwiegender Fehler: require() [function.require]: Fehler beim Öffnen von 'zMovie/phpmailer/PHPMailerAutoload.php' (include_path = '; C: \ Users \ Nazista \ Desktop \ soft \ php5 ') in C: \ Benutzer \ Nazista \ Desktop \ soft \ www \ zMovie \ contact.php in Zeile 2 " –

Antwort

0

Die Zeile sollte wahrscheinlich

require 'zMovie/phpmailer/PHPMailerAutoload.php'; 
+0

aber wenn ich Funktion entferne, gibt es dieses "Warnung: erfordern (zMovie/phpmailer/PHPMailerAutoload.php) [function.require]: konnte Strom nicht öffnen: Keine solche Datei oder Verzeichnis in C: \ Benutzer \ Nazista \ Desktop \ soft \ www \ zMovie \ contact.php in Zeile 2 Schwerwiegender Fehler: require() [function.require]: Fehler beim Öffnen erforderlich 'zMovie/phpmailer/PHPMailerAutoload.php' (include_path = ' .; C: \ Benutzer \ Nazista \ Desktop \ soft \ php5 ') in C: \ Benutzer \ Nazista \ Desktop \ soft \ www \ zMovie \ contact.php in Zeile 2 " –

+0

zeigen Sie es an den Speicherort Ihrer PHPMailerAutoload.php file - ich denke, es wird 'require 'phpmailer/PHPMailerAutoload.php';' – Finwe

+0

aber wenn ich nur setze, dass es mir diese Fehlermeldung Nachricht konnte nicht gesendet werden. Mailer Fehler: Erweiterung fehlt: openssl –