php - Getting swiftmailer to work -


im new php , trying desperately simple contact form on website work using swiftmailer. have library installed right location, , form opens this:

 <form action="mailhandler_girls.php" method="post" enctype="multipart/form-data">  

then in "mailhandler_girls.php" file have following:

 <?php  $_session["post"] = $_post;   $name = $_post["name"]; $email = $_post["email"]; $phone = $_post["phone"]; $dob = $_post['dobday'] ."\t" .$_post['dobmonth'] ."\t" .$_post['dobyear'];$address = $_post['addressline1'] ."\n" .$_post['addressline2'] ."\n" .$_post['postcode'];$experience = $_post["experience"];$height = $_post["height"]; $size = $_post["dresssize"];$bra = $_post["bra"];$waist = $_post["waist"];$hipwidest = $_post["hipwidest"];$bicep = $_post["bicep"];$thigh = $_post["thigh"];$shoe = $_post["shoe"];      require_once 'lib/swift_required.php';  // create transport $transport = swift_smtptransport::newinstance('auth.smtp.1and1.co.uk', 25) ->setusername('user@example.com') ->setpassword('test') ;  // create mailer using created transport $mailer = swift_mailer::newinstance($transport);  // create message $message = swift_message::newinstance('be model application: girls')   // set address associative array ->setfrom(array('$email' => '$name'))  // set addresses associative array ->setto(array('holla@emilekelly.com', 'contact@emilekelly.com' => 'contact test'))  // give body ->setbody('name: ' .$name ."\n" .'email: ' .$email ."\n" .'phone: ' .$phone ."\n" .'address: ' .$address ."\n" .'dob: ' .$dob ."\n" .'experience: ' .$experience ."\n" .'height: ' .$height ."\n" .'dress size: ' .$size ."\n" .'bra: ' .$bra ."\n" .'waist: ' .$waist ."\n" .'hip @ widest: ' .$hipwidest ."\n" .'bicep: ' .$bicep ."\n" .'thigh: ' .$thigh ."\n" .'shoe size: ' .$shoe ."\n" )   // , optionally alternative body ->addpart('<q>here message itself</q>', 'text/html'); // send message $result = $mailer->send($message);     ?> 

nothing happens. im sure im doing wrong obvious, im lost in it. have been using documentation, has got me far, still stuck.

i want basic version working worry elaborating image attachments. im confused smtp transport thing. surely not idea have username , password sitting there in file on net that?

okay, since new 1 , try executing php file first pre defined values instead of $_post commandline .

if on windows, have traverse through directories , this:

php.exe mailhandler_girls.php 

if on linux this:

php5 mailhandler_girls.php  

this elegantly output errors if .

the error message indicate if there problem credentials , problem encryption or whatever may .


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -