473,508 Members | 4,779 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Geeting error:PHP Fatal error: Uncaught exception 'Swift_RfcComplianceException' wit

4 New Member
I am getting error on signup at
<URL removed at request of poster>

PHP Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given [] does not comply with RFC 2822, 3.6.2.' in C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\Headers\ MailboxHeader.php:319
Stack trace:
#0 C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\Headers\ MailboxHeader.php(249): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('')
#1 C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\Headers\ MailboxHeader.php(107): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array)
#2 C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\Headers\ MailboxHeader.php(71): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array)
#3 C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\SimpleHe aderFactory.php(74): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array)
#4 C:\HostingSpa in C:\HostingSpaces\makemycr\makemycreative.in\wwwroo t\source\inc\php\swift\classes\Swift\Mime\Headers\ MailboxHeader.php on line 319
Oct 31 '09 #1
7 4753
Markus
6,050 Recognized Expert Expert
That's all fine and dandy, but without seeing the code itself we cannot possibly help you.

Mark.
Oct 31 '09 #2
yashmistrey
4 New Member
File Name: MailboxHeader.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. /*
  4.  A Mailbox Address Mime Header in Swift Mailer.
  5.  
  6.  This program is free software: you can redistribute it and/or modify
  7.  it under the terms of the GNU General Public License as published by
  8.  the Free Software Foundation, either version 3 of the License, or
  9.  (at your option) any later version.
  10.  
  11.  This program is distributed in the hope that it will be useful,
  12.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  GNU General Public License for more details.
  15.  
  16.  You should have received a copy of the GNU General Public License
  17.  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  
  19.  */
  20.  
  21. //@require 'Swift/Mime/Headers/AbstractHeader.php';
  22. //@require 'Swift/Mime/HeaderEncoder.php';
  23.  
  24. /**
  25.  * A Mailbox Address MIME Header for something like From or Sender.
  26.  * @package Swift
  27.  * @subpackage Mime
  28.  * @author Chris Corbyn
  29.  */
  30. class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
  31. {
  32.  
  33.   /**
  34.    * The mailboxes used in this Header.
  35.    * @var string[]
  36.    * @access private
  37.    */
  38.   private $_mailboxes = array();
  39.  
  40.   /**
  41.    * Creates a new MailboxHeader with $name.
  42.    * @param string $name of Header
  43.    * @param Swift_Mime_HeaderEncoder $encoder
  44.    */
  45.   public function __construct($name, Swift_Mime_HeaderEncoder $encoder)
  46.   {
  47.     $this->setFieldName($name);
  48.     $this->setEncoder($encoder);
  49.     $this->initializeGrammar();
  50.   }
  51.  
  52.   /**
  53.    * Get the type of Header that this instance represents.
  54.    * @return int
  55.    * @see TYPE_TEXT, TYPE_PARAMETERIZED, TYPE_MAILBOX
  56.    * @see TYPE_DATE, TYPE_ID, TYPE_PATH
  57.    */
  58.   public function getFieldType()
  59.   {
  60.     return self::TYPE_MAILBOX;
  61.   }
  62.  
  63.   /**
  64.    * Set the model for the field body.
  65.    * This method takes a string, or an array of addresses.
  66.    * @param mixed $model
  67.    * @throws Swift_RfcComplianceException
  68.    */
  69.   public function setFieldBodyModel($model)
  70.   {
  71.     $this->setNameAddresses($model);
  72.   }
  73.  
  74.   /**
  75.    * Get the model for the field body.
  76.    * This method returns an associative array like {@link getNameAddresses()}
  77.    * @return array
  78.    * @throws Swift_RfcComplianceException
  79.    */
  80.   public function getFieldBodyModel()
  81.   {
  82.     return $this->getNameAddresses();
  83.   }
  84.  
  85.   /**
  86.    * Set a list of mailboxes to be shown in this Header.
  87.    * The mailboxes can be a simple array of addresses, or an array of
  88.    * key=>value pairs where (email => personalName).
  89.    * Example:
  90.    * <code>
  91.    * <?php
  92.    * //Sets two mailboxes in the Header, one with a personal name
  93.    * $header->setNameAddresses(array(
  94.    *  'chris@swiftmailer.org' => 'Chris Corbyn',
  95.    *  'mark@swiftmailer.org' //No associated personal name
  96.    *  ));
  97.    * ?>
  98.    * </code>
  99.    * @param string|string[] $mailboxes
  100.    * @throws Swift_RfcComplianceException
  101.    * @see __construct()
  102.    * @see setAddresses()
  103.    * @see setValue()
  104.    */
  105.   public function setNameAddresses($mailboxes)
  106.   {
  107.     $this->_mailboxes = $this->normalizeMailboxes((array) $mailboxes);
  108.     $this->setCachedValue(null); //Clear any cached value
  109.   }
  110.  
  111.   /**
  112.    * Get the full mailbox list of this Header as an array of valid RFC 2822 strings.
  113.    * Example:
  114.    * <code>
  115.    * <?php
  116.    * $header = new Swift_Mime_Headers_MailboxHeader('From',
  117.    *  array('chris@swiftmailer.org' => 'Chris Corbyn',
  118.    *  'mark@swiftmailer.org' => 'Mark Corbyn')
  119.    *  );
  120.    * print_r($header->getNameAddressStrings());
  121.    * // array (
  122.    * // 0 => Chris Corbyn <chris@swiftmailer.org>,
  123.    * // 1 => Mark Corbyn <mark@swiftmailer.org>
  124.    * // )
  125.    * ?>
  126.    * </code>
  127.    * @return string[]
  128.    * @throws Swift_RfcComplianceException
  129.    * @see getNameAddresses()
  130.    * @see toString()
  131.    */
  132.   public function getNameAddressStrings()
  133.   {
  134.     return $this->_createNameAddressStrings($this->getNameAddresses());
  135.   }
  136.  
  137.   /**
  138.    * Get all mailboxes in this Header as key=>value pairs.
  139.    * The key is the address and the value is the name (or null if none set).
  140.    * Example:
  141.    * <code>
  142.    * <?php
  143.    * $header = new Swift_Mime_Headers_MailboxHeader('From',
  144.    *  array('chris@swiftmailer.org' => 'Chris Corbyn',
  145.    *  'mark@swiftmailer.org' => 'Mark Corbyn')
  146.    *  );
  147.    * print_r($header->getNameAddresses());
  148.    * // array (
  149.    * // chris@swiftmailer.org => Chris Corbyn,
  150.    * // mark@swiftmailer.org => Mark Corbyn
  151.    * // )
  152.    * ?>
  153.    * </code>
  154.    * @return string[]
  155.    * @see getAddresses()
  156.    * @see getNameAddressStrings()
  157.    */
  158.   public function getNameAddresses()
  159.   {
  160.     return $this->_mailboxes;
  161.   }
  162.  
  163.   /**
  164.    * Makes this Header represent a list of plain email addresses with no names.
  165.    * Example:
  166.    * <code>
  167.    * <?php
  168.    * //Sets three email addresses as the Header data
  169.    * $header->setAddresses(
  170.    *  array('one@domain.tld', 'two@domain.tld', 'three@domain.tld')
  171.    *  );
  172.    * ?>
  173.    * </code>
  174.    * @param string[] $addresses
  175.    * @throws Swift_RfcComplianceException
  176.    * @see setNameAddresses()
  177.    * @see setValue()
  178.    */
  179.   public function setAddresses($addresses)
  180.   {
  181.     return $this->setNameAddresses(array_values((array) $addresses));
  182.   }
  183.  
  184.   /**
  185.    * Get all email addresses in this Header.
  186.    * @return string[]
  187.    * @see getNameAddresses()
  188.    */
  189.   public function getAddresses()
  190.   {
  191.     return array_keys($this->_mailboxes);
  192.   }
  193.  
  194.   /**
  195.    * Remove one or more addresses from this Header.
  196.    * @param string|string[] $addresses
  197.    */
  198.   public function removeAddresses($addresses)
  199.   {
  200.     $this->setCachedValue(null);
  201.     foreach ((array) $addresses as $address)
  202.     {
  203.       unset($this->_mailboxes[$address]);
  204.     }
  205.   }
  206.  
  207.   /**
  208.    * Get the string value of the body in this Header.
  209.    * This is not necessarily RFC 2822 compliant since folding white space will
  210.    * not be added at this stage (see {@link toString()} for that).
  211.    * @return string
  212.    * @throws Swift_RfcComplianceException
  213.    * @see toString()
  214.    */
  215.   public function getFieldBody()
  216.   {
  217.     //Compute the string value of the header only if needed
  218.     if (is_null($this->getCachedValue()))
  219.     {
  220.       $this->setCachedValue($this->createMailboxListString($this->_mailboxes));
  221.     }
  222.     return $this->getCachedValue();
  223.   }
  224.  
  225.   // -- Points of extension
  226.  
  227.   /**
  228.    * Normalizes a user-input list of mailboxes into consistent key=>value pairs.
  229.    * @param string[] $mailboxes
  230.    * @return string[]
  231.    * @access protected
  232.    */
  233.   protected function normalizeMailboxes(array $mailboxes)
  234.   {
  235.     $actualMailboxes = array();
  236.  
  237.     foreach ($mailboxes as $key => $value)
  238.     {
  239.       if (is_string($key)) //key is email addr
  240.       {
  241.         $address = $key;
  242.         $name = $value;
  243.       }
  244.       else
  245.       {
  246.         $address = $value;
  247.         $name = null;
  248.       }
  249.       $this->_assertValidAddress($address);
  250.       $actualMailboxes[$address] = $name;
  251.     }
  252.  
  253.     return $actualMailboxes;
  254.   }
  255.  
  256.   /**
  257.    * Produces a compliant, formatted display-name based on the string given.
  258.    * @param string $displayName as displayed
  259.    * @param boolean $shorten the first line to make remove for header name
  260.    * @return string
  261.    * @access protected
  262.    */
  263.   protected function createDisplayNameString($displayName, $shorten = false)
  264.   {
  265.     return $this->createPhrase($this, $displayName,
  266.       $this->getCharset(), $this->getEncoder(), $shorten
  267.       );
  268.   }
  269.  
  270.   /**
  271.    * Creates a string form of all the mailboxes in the passed array.
  272.    * @param string[] $mailboxes
  273.    * @return string
  274.    * @throws Swift_RfcComplianceException
  275.    * @access protected
  276.    */
  277.   protected function createMailboxListString(array $mailboxes)
  278.   {
  279.     return implode(', ', $this->_createNameAddressStrings($mailboxes));
  280.   }
  281.  
  282.   // -- Private methods
  283.  
  284.   /**
  285.    * Return an array of strings conforming the the name-addr spec of RFC 2822.
  286.    * @param string[] $mailboxes
  287.    * @return string[]
  288.    * @access private
  289.    */
  290.   private function _createNameAddressStrings(array $mailboxes)
  291.   {
  292.     $strings = array();
  293.  
  294.     foreach ($mailboxes as $email => $name)
  295.     {
  296.       $mailboxStr = $email;
  297.       if (!is_null($name))
  298.       {
  299.         $nameStr = $this->createDisplayNameString($name, empty($strings));
  300.         $mailboxStr = $nameStr . ' <' . $mailboxStr . '>';
  301.       }
  302.       $strings[] = $mailboxStr;
  303.     }
  304.  
  305.     return $strings;
  306.   }
  307.  
  308.   /**
  309.    * Throws an Exception if the address passed does not comply with RFC 2822.
  310.    * @param string $address
  311.    * @throws Exception If invalid.
  312.    * @access protected
  313.    */
  314.   private function _assertValidAddress($address)
  315.   {
  316.     if (!preg_match('/^' . $this->getGrammar('addr-spec') . '$/D',
  317.       $address))
  318.     {
  319.       throw new Swift_RfcComplianceException(
  320.         'Address in mailbox given [' . $address .
  321.         '] does not comply with RFC 2822, 3.6.2.'
  322.         );
  323.     }
  324.   }
  325.  
  326. }
Oct 31 '09 #3
Markus
6,050 Recognized Expert Expert
Again, I need to see the code you have written.

Also, please use [code] tags when posting code in the forum.

[code] code goes here [/code]
Oct 31 '09 #4
yashmistrey
4 New Member
Here is the whole folder

<URL removed at request of poster>

Rgds
Yash
Oct 31 '09 #5
Markus
6,050 Recognized Expert Expert
In your index.php file, please set error_reporting(E_ALL);

I suspect you have some errors to do with array keys that are not being shown.
Oct 31 '09 #6
yashmistrey
4 New Member
Could please tell me where to set error_reporting(E_ALL);

i am new to php codes, & i just want this sign up form for my website.
so kindly give me an example...

& tell me what kind of array errors.
Oct 31 '09 #7
Markus
6,050 Recognized Expert Expert
@yashmistrey
At the very top of your index.php file. I'm hoping it will then tell us the errors.
Oct 31 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2034
by: steve | last post by:
Hi, In my script (phpnuke), whenever there is access to database, there is this line of code: message_die(GENERAL_ERROR, ’some error msg’, ’’, __LINE__, __FILE__, $sql); Is there a more...
10
9484
by: Gary Hughes | last post by:
I'm getting the following error when attempting to link a managed C++ dll. I can't find any reference to these errors with google. Can anyone help? I've included the class definition causing the...
2
1555
by: universalbitmapper | last post by:
Hi, I'm a newbie learning PHP APACHE MySQL from a manual. I've reached the errors processing chapter, they made me type a nice "error.php" file which handles errors 400, 403, 500, except they...
3
2312
by: vssp | last post by:
Hai Friends While running my application i got this error. How to solve thsi error. Plesae send me any idea. PHP Warning: Cannot modify header information - headers already sent by (output...
4
2187
mikeinspain
by: mikeinspain | last post by:
Keep getting this error! Parse error: syntax error, unexpected $end in /home/9144/domains/cbweb.co.uk/html/faq_finance.php on line 139 PHP Below.. Script was working 1 minute and copied the...
3
1805
by: sachinv1821 | last post by:
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be...
10
2045
by: sachinv1821 | last post by:
hi , i am Getting this Error fatal error C1189: #error : "eh.h is only for C++!" my Problem is i am Having C++ librabry and Appropriate .h file i want to Access Them is .c File Files..... to Be...
5
4370
by: cglobal25 | last post by:
Here is the output from phpinfo() on my laptop running windows vista. As you can see mysql is mentioned several times in the output. I'm not sure why i get this error. Php scripts that i save in...
3
2520
by: gamereality | last post by:
Hello, this is my first post here. W00T. (Forgive me for using leet speak, it's not my fault.) Here's the rundown: I have MySQL. I have configured the PHP.INI to the correct settings,...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.