$transport = Swift_SendmailTransport::newInstance();
$mailer = \Swift_Mailer::newInstance($transport);
$message = \Swift_Message::newInstance();
$message->setSubject('Email From Our Website');
$message->setFrom(array(
$cleanEmail => $cleanName
));
$message->setTo(array('talhagillani96@gmail.com'));
$message->setBody($cleanMessage);
$result = $mailer->send($message);
if($result > 0) {
$app->flash('success', 'Thanks So Much! You are AWESOME!!!');
$app->redirect('/');
} else {
$app->flash('fail', 'So Sorry, Something Went Wrong.Try Again!');
// log that there was an error
$app->redirect('/contact');
}
超薄应用程序错误由于以下错误,应用程序无法运行:
详细信息类型:Swift_TransportException消息:无法启动进程[系统找不到指定的路径。 ]
文件:C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ swiftmailer \ swiftmailer \ lib \ classes \ Swift \ Transport \ StreamBuffer.php行:294跟踪#0 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ swiftmailer \ swiftmailer \ lib \ classes \ Swift \ Transport \ StreamBuffer.php(58):Swift_Transport_StreamBuffer-> _establishProcessConnection()#1 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ swiftmailer \ swiftmailer \ lib \ classes \ Swift \ Transport \ AbstractSmtpTransport.php(113):Swift_Transport_StreamBuffer-> initialize(Array)#2 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ swiftmailer \ swiftmailer \ lib \ classes \ Swift \ Transport \ SendmailTransport.php(51) :Swift_Transport_AbstractSmtpTransport-> start()#3 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ swiftmailer \ swiftmailer \ lib \ classes \ Swift \ Mailer.php(79):Swift_Transport_SendmailTransport-> start()#4 C :\ xampp \ htdocs \ Projects \ php2015 \ index.php(41):Swift_Mailer-> send(Object(Swift_Message))#5 [内部函数]:{closure}()#6 C:\ xampp \ htdocs \ Projects \ php2015 \厂商\苗条\苗条\超薄\ r oute.php(468):call_user_func_array(Object(Closure),Array)#7 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Slim.php(1357):Slim \ Route-> dispatch()#8 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Middleware \ Flash.php(85):Slim \ Slim-> call()#9 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Middleware \ MethodOverride.php(92):Slim \ Middleware \ Flash-> call()#10 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Middleware \ SessionCookie.php(110):Slim \ Middleware \ MethodOverride-> call()#11 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Middleware \ PrettyExceptions.php (67):Slim \ Middleware \ SessionCookie-> call()#12 C:\ xampp \ htdocs \ Projects \ php2015 \ vendor \ slim \ slim \ Slim \ Slim.php(1302):Slim \ Middleware \ PrettyExceptions-&gt ; call()#13 C:\ xampp \ htdocs \ Projects \ php2015 \ index.php(53):Slim \ Slim-> run()#14 {main}
答案 0 :(得分:4)