Re: [PHP] phpmailer send() always return true even the emailaddress is invalid
Ashley Sheridan wrote: On Thu, 2009-08-27 at 20:38 +0800, Keith wrote: Due to my web hosting server implement SMTP authentication, I couldn't do it with PHP mail() function, so I opt for PHPMailer. However, the $mail->Send() method always return true even I've set the $mail->AddAddress with invalid email address. I've tried with valid address. It's good and I've received the email. Then I set it with invalid x...@gmail.com, the return value is true, and I have received email from mailer daemon that gmail has rejected the email. Then I set the $mail->Address with invalid name & invalid domain. This time, the $mail->Send() still return as true, however, I didn't receive email from mailer daemon this time. Any idea why this happened? Any solution for me or suggestion to use other send mail class/function that support SMTP authentication? Thanks! Keith The return code only informs you that the mail was sent successfully, not that it was received, so you can have invalid email addresses and still have the function return true. Thanks, Ash http://www.ashleysheridan.co.uk Exactly, you should validate the e-mail addresses before sending the mail. Something like this: http://php.dzone.com/news/php-email-validator-email-mx-d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ReflectionClass
Hi, Do you know where can I find more information about using the ReflectionClass. What is it for? In which situation can I use it and so on. Thank you in advance! Viktor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function problem
Hi, I'm trying to do the following but I don't have any success. Could you help me here... I have this code in mu page: $value) { $$key = $value; } $valid = $fn = checkLength($fname, 2, 50); $ln = checkLength($family, 2, 50); $valid = $valid && $ln; $cm = checkLength($company,0,50); $valid = $valid && $cm; $ml = checkLength($MOL,0,50); $valid = $valid && $ml; $dnum = checkLength($dannum,0,12); $valid = $valid && $dnum; $bst = checkLength($bulstat,0,12); $valid = $valid && $bst; $phn = checkLength($phone,3,20); $valid = $valid && $phn; $em = checkEmail($email); $valid = $valid && $em; $usr = checkLength($username,4,10); $valid = $valid && $usr; $ps = checkLength($password,4,16); $valid = $valid && $ps; $ps2 = checkLength($password2,4,16); $valid = $valid && $ps2; $ps2 = $password == $password2; $valid = $valid && $ps2; $adr = checkLength($Addr,3,70); $valid = $valid && $adr; $cty = checkLength($City,2,50); $valid = $valid && $cty; $zp = checkLength($zipcode,2,10); $valid = $valid && $zp; if ($valid) { //-CHECK THIS--- doReg($fname,$family,$company, $MOL, $dannum, $bulstat, $phone, $email, $username, $password, $payment, $maillist, $Addr, $City, $zipcode, $Country, $shippingName, $shippingFamily, $shippingphone, $shippingAddr, $shippingcity, $shippingzipcode, $shippingCountry); exit; } } else { $fn = $ln = $cm = $ml = $dnum = $bst = $phn = $em = $usr = $ps = $ps2 = $adr = $cty = $zp = TRUE; $fname = $family = $company = $MOL = $dannum = $bulstat = $phone = $email = $username = $password = $password2 = $Addr = $City = $zipcode = ''; } ?> This is a page with validation. If everything is correct($valid==TRUE), I would like to call doReg which must do the following: function doReg($fname1="",$family1="",$company1="", $MOL1="", $dannum1="", $bulstat1="", $phone1="", $email1="", $username1="", $password1="", $payment1="", $maillist1="", $Addr1="", $City1="", $zipcode1="", $Country1="", $shippingName1="", $shippingFamily1="", $shippingphone1="", $shippingAddr1="", $shippingcity1="", $shippingzipcode1="", $shippingCountry1="") { mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD); mysql_db_query($DB, "insert into users(name,family,company, MOL, taxnum, bulstat, phone, email, username, password, payment, maillist, Addr, City, zipcode, Country, shippingName, shippingFamily, shippingphone, shippingAddr, shippingcity, shippingzipcode, shippingCountry) values('$fname1','$family1','$company1', '$MOL1', '$dannum1', '$bulstat1', '$phone1', '$email1', '$username1', '$password1', '$payment1', '$maillist1', '$Addr1', '$City1', '$zipcode1', '$Country1','$shippingName1','$shippingFamily1', '$shippingphone1','$shippingAddr1', '$shippingcity1', '$shippingzipcode1', '$shippingCountry1')"); } The problem is that it doesn't work. I have tryed to put the code from the doReg function in the page and it works. But when I call the function I can't insert nothing. Why is that? could you tell me? Thank you in advance!! Viktor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function problem
Hi! Thank you for the reply! I have change the function: function doReg($fname1="",$family1="",$company1="", $MOL1="", $dannum1="", $bulstat1="", $phone1="", $email1="", $username1="", $password1="", $payment1="", $maillist1="", $Addr1="", $City1="", $zipcode1="", $Country1="", $shippingName1="", $shippingFamily1="", $shippingphone1="", $shippingAddr1="", $shippingcity1="", $shippingzipcode1="", $shippingCountry1="") { if(!($link = mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD))) { echo "the connection failed"; exit(); } if(!($newresult = mysql_db_query($DB, "insert into users(name,family,company, MOL, taxnum, bulstat, phone, email, username, password, payment, maillist, Addr, City, zipcode, Country, shippingName, shippingFamily, shippingphone, shippingAddr, shippingcity, shippingzipcode, shippingCountry) values('$fname1','$family1','$company1', '$MOL1', '$dannum1', '$bulstat1', '$phone1', '$email1', '$username1', '$password1', '$payment1', '$maillist1', '$Addr1', '$City1', '$zipcode1', '$Country1','$shippingName1','$shippingFamily1', '$shippingphone1','$shippingAddr1', '$shippingcity1', '$shippingzipcode1', '$shippingCountry1')"))) { echo "the insertiont cannot be done"; exit(); } header("Location:http://$HTTP_HOST/$DOCROOT/allright.html";); exit(); } When i try to insert -> the problem is in the insertion. The message "the insertiont cannot be done"; appears. Do you know what could be the mistake? Thank you! Viktor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: function problem
Hi, thank you for your reply! I'll consider carefully this holes. Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: function problem
Hi, Thank you for your reply! I have changed the function like this: function doReg($fname1="",$family1="",$company1="", $MOL1="", $dannum1="", $bulstat1="", $phone1="", $email1="", $username1="", $password1="", $payment1="", $maillist1="", $Addr1="", $City1="", $zipcode1="", $Country1="", $shippingName1="", $shippingFamily1="", $shippingphone1="", $shippingAddr1="", $shippingcity1="", $shippingzipcode1="", $shippingCountry1="") { mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD) or die(mysql_error()); mysql_select_db($DB) or die(mysql_error()); mysql_query( "insert into users(name,family,company, MOL, taxnum, bulstat, phone, email, username, password, payment, maillist, Addr, City, zipcode, Country, shippingName, shippingFamily, shippingphone, shippingAddr, shippingcity, shippingzipcode, shippingCountry) values('$fname1','$family1','$company1', '$MOL1', '$dannum1', '$bulstat1', '$phone1', '$email1', '$username1', '$password1', '$payment1', '$maillist1', '$Addr1', '$City1', '$zipcode1', '$Country1','$shippingName1','$shippingFamily1', '$shippingphone1','$shippingAddr1', '$shippingcity1', '$shippingzipcode1', '$shippingCountry1')") or die (mysql_error()); } I think that the problem is not in the insertion string because when write the function body : mysql_pconnect(.); mysql_select_db($DB) or die(mysql_error()); mysql_query("insert into "); instead doReg() in register.php, everything works. I have inserted some data in this way. The problem is that A DATABASE is NOT SELECTED. This is the message when I use doReg(). The register.php is in the DOCROOT->emagazine. In the subdirectory script are "common.inc" and "functions.php". In common.inc is this: Is it all right? I think that $DB="emagazine" should work. Here I select the $DB, which name is "emagazine". I don't understand what's going on:) Thank you! Viktor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php