Results 1 to 7 of 7

Thread: CC and BCC not working

  1. #1
    Join Date
    Mar 2013
    Posts
    3

    Default CC and BCC not working

    I use FormMail on my website and it has worked quite well. However I recently have discovered a problem whereby CC and BCC do not work.

    This works just fine to send to both accounts:
    <input value="name1@domain1.com, name2@domain2.com " name="recipients" type="hidden" />

    However this only sends to the main recipient (not the CC):
    <input value="name1@domain1.com" name="recipients" type="hidden" />
    <input value="name2@domain2.com" name="cc" type="hidden" />

    As does this (sends to main, but not the BCC):
    <input value="name1@domain1.com" name="recipients" type="hidden" />
    <input value="name2@domain2.com" name="bcc" type="hidden" />

    I saw some notes about earlier versions of php not supporting BCC, but we’re currently running PHP 5.3.

    Do you have any advice for me? Is this an issue with the mail software on the server? If so, anything specific I should ask my webhost about?

  2. #2
    Join Date
    May 2008
    Posts
    1,291

    Default Re: CC and BCC not working

    Have you tried using a server side INI file and putting the cc and bcc into the special_fields section? I don't know if I've ever used cc and bcc, it but it might work ... and even if it doesn't work for cc and bcc it's best to keep the recipients' email address out of the source code of the form.

    Code:
    [special_fields]
    recipients = "someone@yourdomain.com"
    cc = "someoneelse@yourdomain.com"
    bcc = "thirdperson@yourdomain.com"
    Here's the documentation on server side INI files:

    http://www.tectite.com/fmhowto/inifile.php

    ginger

  3. #3
    Join Date
    Mar 2013
    Posts
    3

    Default Re: CC and BCC not working

    Thank you for the reply. I have not tried this method before, but will experiment with it. I do have one question before getting started though. I have many different pages/sites that refer to the same formmail php file. Is there a way to indicate that only this one specific page should refer to this custom ini file while the rest should continue to use the default configuration? Or is there a way to setup different ini files for the different sites?

  4. #4
    Join Date
    Nov 2006
    Posts
    28

    Default Re: CC and BCC not working

    I do actually use the CC fields. Yours are correct in the format. I don't know if the order would matter - I wouldn't think so.

    Did you add the address that is in the BCC and CC to your formmail.php file under $TARGET_EMAIL (about line #260)?

  5. #5
    Join Date
    Mar 2013
    Posts
    3

    Default Re: CC and BCC not working

    Yes, if you see from my post, it does successfully send to both addresses if they're both comma-separated in the recipients field. This is how I know it's not a block on the receiving address. It's only a problem once they're moved to CC or BCC.

  6. #6
    Join Date
    Apr 2013
    Posts
    2

    Default Re: CC and BCC not working

    Please someone could work with "cc" and "bcc".
    thanks, velasquez

  7. #7
    Join Date
    Apr 2013
    Posts
    2

    Default Re: CC and BCC not working

    Quote Originally Posted by velasquez View Post
    Please someone could work with "cc" and "bcc".
    thanks, velasquez
    1- I tested the script below and it worked smoothly with the field "cc"
    Name -> testmailcc.php
    Code:
    <?php
    $to = "somebody@example.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@example.com" . "\r\n" .
    "CC: somebodyelse@example.com";
    mail($to,$subject,$txt,$headers);
    ?>
    2- but I can not work with the line below:
    <input type="hidden" name="cc" value="you@yoursite.com" />

    The following error occurred in FormMail :
    mail_failed
    **********
    Error=Failed to send email

    --------------------------------------------------------------
    3- The e-mail are in a file called form.ini.
    4- I tested the file with formmail.php .Ini and it worked very well.

    Test OK - <input type="hidden" name="recipients" value="mail1" />
    Test OK - <input type="hidden" name="recipients" value="mail1,mail2,mail3" />
    --------------------------------------------------------------

    I'm working with the version "8:36" for formmail.php.

    ** Information obtained with phpinfo.php on my server. **

    PHP Version 5.3.3-7+squeeze3

    System Linux mailserver 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64
    Server API Apache 2.0 Handler

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copied working scripts to different site -- not working
    By rochrunner in forum Community Support
    Replies: 0
    Last Post: 01-Jun-2012, 02:01 PM
  2. Adding a field to a working form - - not working.
    By jgoodfriend in forum Community Support
    Replies: 4
    Last Post: 11-Aug-2011, 11:01 PM
  3. Troubles getting this working - email not working
    By Bill in forum Community Support
    Replies: 8
    Last Post: 15-Jun-2011, 08:14 PM
  4. Replies: 0
    Last Post: 08-Apr-2011, 04:51 PM
  5. Replies: 3
    Last Post: 21-Oct-2010, 08:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •