Menu

Confirmation email + cc

Help
2015-06-09
2015-06-09
  • PierLuigi Franchi

    Greetings!

    I would like to have my form to be sent to 3 different addresses:

    1) the main delivery mailbox
    2) a copy to the submitter
    3) a second administrator, as CC

    my code is like this one (excerpt):

    <snip>

    mail("mymail@myadd.net","Official request","Form data:

    Nome: " . $_POST['field_1'] . "
    Cognome: " . $_POST['field_2'] . "
    Data di nascita: " . $_POST['field_3'] . "
    Sesso: " . $_POST['field_4'] . "
    Indirizzo: " . $_POST['field_5'] . "
    Indirizzo (continua): " . $_POST['field_6'] . "
    Città: " . $_POST['field_7'] . "
    CAP: " . $_POST['field_8'] . "
    Provincia: " . $_POST['field_9'] . "
    Nazione: " . $_POST['field_10'] . "
    Tipo licenza richiesta: " . $_POST['field_12'] . "
    E-mail: " . $_POST['field_13'] . "
    Password di accesso: " . $_POST['field_15'] . "
    Pagamento tramite : " . $_POST['field_19'] . "

    <snip>

    Now, I know that I can add an email add with a comma within the first variable field

    ex: mail("mymail@myadd.net, secondadministrator@myadd.net","Official request","Form data:

    but it's POINT 2 in the question I am not able to set.
    How could I add the variable 13 ( E-mail: " . $_POST['field_13'] . ") to the delivery target?
    ex: mail("mymail@myadd.net, ???, secondadministrator@myadd.net","Official request","Form data:

    Thanks in advance to everyone

     
  • PierLuigi Franchi

    Wait!
    I think I solved it.

    I publish it here so maybe it will be of some help for people curious about it.

    mail("mymail@myadd.net, " . $_POST['field_13'] . ", secondadministrator@myadd.net","Official request","Form data:

    Ciao!! :D

     

    Last edit: PierLuigi Franchi 2015-06-09
  • PierLuigi Franchi

    (Yeah I know, I thought it was something more complicated and - as we say in italy - "mi sono fasciato la testa prima di prendere il colpo"*)

    • To make a head bandage before being hit
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.