Body: <p>If a user registers for an event the registration confirmation email does not get sent. The registration completes, however they see this error message: </p>
  
  <p><a href="https://i.sstatic.net/3BSqz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3BSqz.png" alt="Mailing Error"></a></p>
  
  <p>I am using mail() and when I test Outbound Mail settings, it works.</p>
  
  <p>Now the BUT… part:
  If I register a participant using the Register Event Participant option in the backend, the registration completes and the registration confirmation email is sent to the user.</p>
  
  <p>I am stumped.</p>
  
  <p>Were running CiviCRM 4.6.8 on Wordpress 4.3.1</p>
  
  <p>When I 'Redirect to database' the emails get into the spool table. See Screenshot:
  <a href="https://i.sstatic.net/HNoL5.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HNoL5.jpg" alt="civicrm_mailing_spool"></a></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-30T01:36:37.003Z
Comments.Text: You say you are using mail() in your outbound mail settings, /(as opposed to SMTP or Sendmail..), odd that the error msg references SMTP.  What happens if you set 'Redirect to database', do your reg.emails at least get into the spool table?
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-30T15:25:26.870Z
Comments.Text: When I 'Redirect to database' the emails get into the spool table. I have updated the question with this info and a screenshot.
Comments.UserDisplayName: jursulak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-30T17:03:33.207Z
Comments.Text: Thanks JUrsulak- I think that confirms no problem w/event reg. data or mail template. I just set up a 4.6 test system, selected 'mail()' and though the test email was sent, reg. conf. email got error - however using 'SMTP' reg. email was sent successfully. Is SMTP set up on your server (ping port 25)? can you try it?
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-09-30T17:08:30.627Z
Comments.Text: Thanks Lesley. SMTP is set up on our server. However, we use Google for Nonprofits for our email. I'm assuming that throws a wrench into things???
  
  I have looked at trying to setup SMTP using Gmail but none of that seemed to work.
Comments.UserDisplayName: jursulak
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T02:08:35.353Z
Comments.Text: Outgoing Mail (SMTP) Server: smtp.gmail.com
  Use Authentication: Yes
  Use Secure Connection: Yes (this can be TLS or SSL depending on your mail client)
  Username: your GMail/Google account
  Password: your GMail/Google password
  Port: 465 or 587 - I am not sure if and whether you can set this up using your (host) CPanel. What did you do/how did you try to setup SMTP?  btw I wonder if your host allows php mail(), is that something they can tell you?
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T02:55:01.710Z
Comments.Text: I checked the Civi PHP code - 'Save and Test Email' is not the same as code used to send confirm. emails (not surprising)..
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T03:14:06.590Z
Comments.Text: So never mind about asking whether your host allows php mail, the 'test email' and backend reg worked
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T14:46:44.413Z
Comments.Text: I found that mail() worked for me after I modified CRM/Utils/Mail.php, line 99... to only add 'CC' or 'BCC' if the params are not blank, that is, insert: "if (CRM_Utils_Array::value('cc', $params) != NULL){ " before "$headers['Cc'] = CRM_Utils_Array::value('cc', $params);"   Since PHP isn't a compiled language for better or worse, it is not hard to try this out.  I tried it w/event registration with and without CC
Comments.UserDisplayName: Lesley Evensen
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-01T15:57:28.740Z
Comments.Text: Here's the mod to Mail.php:
      if (CRM_Utils_Array::value('cc', $params) != NULL){
        $headers['Cc'] = CRM_Utils_Array::value('cc', $params);
      }
      if (CRM_Utils_Array::value('bcc', $params) != NULL){
        $headers['Bcc'] = CRM_Utils_Array::value('bcc', $params);
      }
Comments.UserDisplayName: Lesley Evensen
Tags: <civievent><email>
Title: Confirmation email not sent upon registration BUT…
ThreadText: # Confirmation email not sent upon registration BUT…
  
  (Asked by: username_0 on 2015-09-29)
  
  If a user registers for an event the registration confirmation email does not get sent. The registration completes, however they see this error message:
  
  [![Mailing Error](https://i.sstatic.net/3BSqz.png)](https://i.sstatic.net/3BSqz.png)
  
  I am using mail() and when I test Outbound Mail settings, it works.
  
  Now the BUT… part:
  If I register a participant using the Register Event Participant option in the backend, the registration completes and the registration confirmation email is sent to the user.
  
  I am stumped.
  
  Were running CiviCRM 4.6.8 on Wordpress 4.3.1
  
  When I 'Redirect to database' the emails get into the spool table. See Screenshot:
  [![civicrm_mailing_spool](https://i.sstatic.net/HNoL5.jpg)](https://i.sstatic.net/HNoL5.jpg)
  
  **Tags:** civievent, email
  
  > **Comments:**
  > **username_1**: You say you are using mail() in your outbound mail settings, /(as opposed to SMTP or Sendmail..), odd that the error msg references SMTP.  What happens if you set 'Redirect to database', do your reg.emails at least get into the spool table?  
  > **username_0**: When I 'Redirect to database' the emails get into the spool table. I have updated the question with this info and a screenshot.  
  > **username_1**: Thanks JUrsulak- I think that confirms no problem w/event reg. data or mail template. I just set up a 4.6 test system, selected 'mail()' and though the test email was sent, reg. conf. email got error - however using 'SMTP' reg. email was sent successfully. Is SMTP set up on your server (ping port 25)? can you try it?  
  > **username_0**: Thanks username_1. SMTP is set up on our server. However, we use Google for Nonprofits for our email. I'm assuming that throws a wrench into things???  I have looked at trying to setup SMTP using Gmail but none of that seemed to work.  
  > **username_1**: Outgoing Mail (SMTP) Server: smtp.gmail.com Use Authentication: Yes Use Secure Connection: Yes (this can be TLS or SSL depending on your mail client) Username: your GMail/Google account Password: your GMail/Google password Port: 465 or 587 - I am not sure if and whether you can set this up using your (host) CPanel. What did you do/how did you try to setup SMTP?  btw I wonder if your host allows php mail(), is that something they can tell you?  
  > **username_1**: I checked the Civi PHP code - 'Save and Test Email' is not the same as code used to send confirm. emails (not surprising)..  
  > **username_1**: So never mind about asking whether your host allows php mail, the 'test email' and backend reg worked  
  > **username_1**: I found that mail() worked for me after I modified CRM/Utils/Mail.php, line 99... to only add 'CC' or 'BCC' if the params are not blank, that is, insert: "if (CRM_Utils_Array::value('cc', $params) != NULL){ " before "$headers['Cc'] = CRM_Utils_Array::value('cc', $params);"   Since PHP isn't a compiled language for better or worse, it is not hard to try this out.  I tried it w/event registration with and without CC  
  > **username_1**: Here's the mod to Mail.php:     if (CRM_Utils_Array::value('cc', $params) != NULL){       $headers['Cc'] = CRM_Utils_Array::value('cc', $params);     }     if (CRM_Utils_Array::value('bcc', $params) != NULL){       $headers['Bcc'] = CRM_Utils_Array::value('bcc', $params);     }  
  
  ---
  
  ## 0 answers
  
  