Monday, 22 June 2015

PHP 7 For Developers

Return Types

function myfunction(): array {
    return [];
}

he return types can only be what we have for types right now, meaning no scalar values, no return types like stringintbool, etc. This means that your methods and functions that return such values will still be unsigned. You can remedy this by returning instances of wrappers for such values, but that’s overkill in the vast majority of cases.







Tuesday, 2 June 2015

Php Send mail By php mailer library

this is the code for send mail using php Mailer

<?php
require 'PHPMailer/PHPMailerAutoload.php';
 
$mail = new PHPMailer;
 
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'abc@gmail.com';
$mail->Password = '******';
$mail->SMTPSecure = 'tls';
 
$mail->From = 'abcw@gmail.com';
$mail->FromName = 'abc xyz';
$mail->addAddress('defgw@example.com', 'some one');
 
$mail->addReplyTo('abc.amalw@gmail.com', 'some other');
 
$mail->WordWrap = 50;
$mail->isHTML(true);
 
$mail->Subject = 'Using PHPMailer';
$mail->Body    = 'Hi.. this is email body';
 
if(!$mail->send()) {
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}
 
echo 'Message has been sent';

?>

this is simple and secured method to send mail


this mail is not receive in spam or other folders because it is secured