當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ezcMailTools::validateEmailAddress方法代碼示例

本文整理匯總了PHP中ezcMailTools::validateEmailAddress方法的典型用法代碼示例。如果您正苦於以下問題:PHP ezcMailTools::validateEmailAddress方法的具體用法?PHP ezcMailTools::validateEmailAddress怎麽用?PHP ezcMailTools::validateEmailAddress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ezcMailTools的用法示例。


在下文中一共展示了ezcMailTools::validateEmailAddress方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

 }
 $customDataText2 = '';
 if (isset($item['custom_data_text_2'])) {
     $customDataText2 = $item['custom_data_text_2'];
 }
 $customDataText3 = '';
 if (isset($item['custom_data_text_3'])) {
     $customDataText3 = $item['custom_data_text_3'];
 }
 $customDataText4 = '';
 if (isset($item['custom_data_text_4'])) {
     $customDataText4 = $item['custom_data_text_4'];
 }
 $eZUserId = false;
 $newsletterUserId = 0;
 $emailOk = ezcMailTools::validateEmailAddress($email);
 $subscriptionObject = null;
 $createNewUser = 0;
 // 0 - no, 1 - yes, 2 - updated
 $createNewSubscription = 0;
 // store status from existing objects and new stati after import/update
 $existingUserStatus = -1;
 $existingSubscriptionStatus = -1;
 $newUserStatus = -1;
 $newSubscriptionStatus = -1;
 $userIsBlacklistedOrRemoved = false;
 if (!$emailOk) {
     $emailOk = 0;
 } else {
     $emailOk = 1;
     if ($csvImportHasPrio == false) {
開發者ID:hudri,項目名稱:cjw_newsletter,代碼行數:31,代碼來源:subscription_list_csvimport.php

示例2: testValidateEmailAddressMXThrowException

 public function testValidateEmailAddressMXThrowException()
 {
     if (ezcBaseFeatures::hasFunction('getmxrr') && ezcBaseFeatures::hasFunction('checkdnsrr')) {
         $this->markTestSkipped('This test works only if getmxrr() or checkdnsrr() support is missing');
     }
     try {
         ezcMailTools::validateEmailAddress('john.doe@example.com', true);
         $this->fail('Expected exception was not thrown.');
     } catch (ezcBaseFunctionalityNotSupportedException $e) {
         $this->assertEquals('Checking DNS records is not supported. Reason: getmxrr() or checkdnsrr() missing.', $e->getMessage());
     }
 }
開發者ID:jacomyma,項目名稱:GEXF-Atlas,代碼行數:12,代碼來源:tools_test.php

示例3: array

$mailAddresses = array(new ezcMailAddress('john@example.com', 'Jøhn Doe', 'ISO-8859-1'), new ezcMailAddress('jane@example.com', 'Jane Doe'));
$addresses = '=?ISO-8859-1?B?SsO4aG4gRG9l?= <john@example.com>, Jane Doe <jane@example.com';
// Convert ezcMailAddress to string representation
var_dump(ezcMailTools::composeEmailAddress($mailAddresses[0]));
var_dump(ezcMailTools::composeEmailAddresses($mailAddresses));
// Convert string to ezcMailAddress
var_dump(ezcMailTools::parseEmailAddress($addresses));
var_dump(ezcMailTools::parseEmailAddresses($addresses));
// Validate an email address (with a regular expression, without checking for MX records)
$isValid = ezcMailTools::validateEmailAddress('john.doe@example.com');
// Validate an email address with MX records check.
// MX record checking does not work on Windows due to the lack of getmxrr()
// and checkdnsrr() PHP functions. The ezcBaseFunctionalityNotSupportedException
// is thrown in this case.
// set this to your mail server, it is used in a
// 'HELO SMTP' command to validate against MX records
ezcMailTools::$mxValidateServer = 'your.mail.server';
// set this to a mail address such as 'postmaster@example.com', it is used in a
// 'MAIL FROM' SMTP command to validate against MX records
ezcMailTools::$mxValidateAddress = 'email.address@mail.server';
$isValid = ezcMailTools::validateEmailAddress('john.doe@example.com', true);
// Create a new mail object
$mail = new ezcMail();
$mail->from = $mailAddresses[1];
$mail->addTo($mailAddresses[0]);
$mail->subject = "Top secret";
// Use the lineBreak() method
$mail->body = new ezcMailText("Confidential" . ezcMailTools::lineBreak() . "DO NOT READ");
$mail->generate();
// Create a reply message to the previous mail object
$reply = ezcMailTools::replyToMail($mail, new ezcMailAddress('test@example.com', 'Reply Guy'));
開發者ID:notion,項目名稱:zeta-mail,代碼行數:31,代碼來源:tutorial_tools.php


注:本文中的ezcMailTools::validateEmailAddress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。