diff --git a/examples/code_generator.phps b/examples/code_generator.phps index d9a4da0a..9faf7393 100644 --- a/examples/code_generator.phps +++ b/examples/code_generator.phps @@ -91,10 +91,8 @@ try { $example_code .= "\n\$mail->Host = \"" . $_POST['smtp_server'] . "\";"; $example_code .= "\n\$mail->Port = \"" . $_POST['smtp_port'] . "\";"; $example_code .= "\n\$mail->SMTPSecure = \"" . strtolower($_POST['smtp_secure']) . "\";"; - $example_code .= "\n\$mail->SMTPAuth = " . (array_key_exists( - 'smtp_authenticate', - $_POST - ) ? 'true' : 'false') . ";"; + $example_code .= "\n\$mail->SMTPAuth = " . + (array_key_exists('smtp_authenticate', $_POST) ? 'true' : 'false') . ";"; if (array_key_exists('smtp_authenticate', $_POST)) { $example_code .= "\n\$mail->Username = \"" . $_POST['authenticate_username'] . "\";"; $example_code .= "\n\$mail->Password = \"" . $_POST['authenticate_password'] . "\";"; diff --git a/examples/simple_contact_form.phps b/examples/simple_contact_form.phps index f422edcc..c5db5592 100644 --- a/examples/simple_contact_form.phps +++ b/examples/simple_contact_form.phps @@ -12,6 +12,7 @@ require '../vendor/autoload.php'; if (array_key_exists('to', $_POST)) { $err = false; $msg = ''; + $email = ''; //Apply some basic validation and filtering to the subject if (array_key_exists('subject', $_POST)) { $subject = substr(strip_tags($_POST['subject']), 0, 255); @@ -55,9 +56,9 @@ if (array_key_exists('to', $_POST)) { $mail->Host = 'localhost'; $mail->Port = 2500; $mail->CharSet = 'utf-8'; - //It's important not to use the submitter's address as the form address as it's forgery, - //which will cause our messages to fail SPF checks - //Use an address in your own domain here + //It's important not to use the submitter's address as the from address as it's forgery, + //which will cause your messages to fail SPF checks. + //Use an address in your own domain as the from address, put the submitter's address in a reply-to $mail->setFrom('contact@example.com', (empty($name)? 'Contact form': $name)); $mail->addAddress($to); $mail->addReplyTo($email, $name); diff --git a/examples/smime_signed_mail.phps b/examples/smime_signed_mail.phps index 059d24f4..50ef0fa1 100644 --- a/examples/smime_signed_mail.phps +++ b/examples/smime_signed_mail.phps @@ -6,7 +6,8 @@ * * * STEP 1 - Creating a certificate: - * You can either use a self signed certificate, pay for a signed one or use free alternatives such as StartSSL/Comodo etc. + * You can either use a self-signed certificate, pay for a signed one, + * or use free alternatives such as StartSSL, Comodo etc. * Check out this link for more providers: http://kb.mozillazine.org/Getting_an_SMIME_certificate * In this example I am using Comodo. * The form is directly available via https://secure.comodo.com/products/frontpage?area=SecureEmailCertificate diff --git a/get_oauth_token.php b/get_oauth_token.php index 7a0ea9b5..40c46aa5 100644 --- a/get_oauth_token.php +++ b/get_oauth_token.php @@ -51,6 +51,7 @@ if (!isset($_GET['code']) && !isset($_GET['provider'])) { Yahoo
Microsoft/Outlook/Hotmail/Live/Office365
+ getAuthorizationUrl($options); diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 72042ea6..7c3fba07 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -1228,7 +1228,8 @@ class PHPMailer if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) { $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); //Ignore IDE complaints about this line - method signature changed in PHP 5.4 - if (false !== ($punycode = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46))) { + $errorcode = 0; + if (false !== ($punycode = idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46))) { return substr($address, 0, $pos) . $punycode; } } diff --git a/test/fakesendmail.sh b/test/fakesendmail.sh index c9f17a56..edf0479a 100755 --- a/test/fakesendmail.sh +++ b/test/fakesendmail.sh @@ -5,18 +5,18 @@ #Create a temp folder to put messages in numPath="${TMPDIR-/tmp/}fakemail" umask 037 -mkdir -p $numPath +mkdir -p ${numPath} -if [ ! -f $numPath/num ]; then - echo "0" > $numPath/num +if [ ! -f ${numPath}/num ]; then + echo "0" > ${numPath}/num fi -num=`cat $numPath/num` -num=$(($num + 1)) -echo $num > $numPath/num +num=`cat ${numPath}/num` +num=$((${num} + 1)) +echo ${num} > ${numPath}/num -name="$numPath/message_$num.eml" +name="${numPath}/message_${num}.eml" while read line do - echo $line >> $name + echo ${line} >> ${name} done exit 0