Guest User

Untitled

a guest
Jun 3rd, 2018
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. <?
  2.  
  3. ## This is how I generate the $to field for my message
  4. $recipients = array();
  5. foreach(explode(',',$return) as $email)
  6. {
  7. $recipients[] = array($email);
  8. }
  9.  
  10. return $recipients;
  11.  
  12. ## which generates this
  13. (array) Array
  14. (
  15. [0] => Array
  16. (
  17. [0] => bendalton@gmail.com
  18. )
  19.  
  20. [1] => Array
  21. (
  22. [0] => 3173081415@txt.att.net
  23. )
  24.  
  25. )
  26.  
  27.  
  28. ## this is my email send code
  29. email::send($to, $from, $subject, $message, TRUE);
  30.  
  31. ## This is what is eventually generated from my array
  32. (object) Swift_RecipientList Object
  33. (
  34. [to:protected] => Array
  35. (
  36. [bendalton@gmail.com] => Swift_Address Object
  37. (
  38. [address:protected] => bendalton@gmail.com
  39. [name:protected] => Array
  40. )
  41.  
  42. )
  43.  
  44. [cc:protected] => Array
  45. (
  46. )
  47.  
  48. [bcc:protected] => Array
  49. (
  50. )
  51.  
  52. [iterators:protected] => Array
  53. (
  54. [to] =>
  55. [cc] =>
  56. [bcc] =>
  57. )
  58.  
  59. )
  60.  
  61. ## $recipients[] = $email provides this result
  62. (object) Swift_RecipientList Object
  63. (
  64. [to:protected] => Array
  65. (
  66. [bendalton@gmail.com] => Swift_Address Object
  67. (
  68. [address:protected] => bendalton@gmail.com
  69. [name:protected] => 3173081415@txt.att.net
  70. )
  71.  
  72. )
Add Comment
Please, Sign In to add comment