The sender's email address is not displayed correctly by the recipient.

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
fgazza
Veteran Member
Posts: 205
Joined: 2019-04-30 17:37

The sender's email address is not displayed correctly by the recipient.

Post by fgazza » 2020-04-18 11:11

Hello to all.

I set in the hook file of the "partecipazione_riunione_evento_partner" table the automatic sending of an email to the users when they fill in the table.

I don't know why but the email that arrives to users does not appear with the address I set ([email protected]) but with a "strange" address that has to do with my email provider. The strange address that appear is:
[email protected]

This makes it difficult for users to notice the notification by e-mail of the correct compilation of the form and I believe it also facilitates the automatic archiving as spam in their e-mail boxes (especially for those who use gmail).

I hope someone can give me some suggestions.

Here is the code that I put in the hook file.

Thank you all!

Fabiano Gazza

__________ code__________

function partecipazione_riunione_evento_partner_after_insert($data, $memberInfo, &$args){

// to compose a message containing the submitted data,
// we need to iterate through the $data array
//foreach($data as $field => $value){
//$messageData .= "$field: $value \n";
//}

$titolo_evento = sqlValue(
"SELECT titolo FROM appuntamenti where pri_key = '{$data['riunione_evento']}'"
);

$data_evento = sqlValue(
"SELECT data_appuntamento FROM appuntamenti where pri_key = '{$data['riunione_evento']}'"
);

$data_evento = date("d-m-Y", strtotime ($data_evento));

$dove_evento = sqlValue(
"SELECT luogo FROM appuntamenti where pri_key = '{$data['luogo_evento']}'"
);

$orario_inizio_evento = sqlValue(
"SELECT ora_inizio FROM appuntamenti where pri_key = '{$data['orario']}'"
);

$orario_fine_evento = sqlValue(
"SELECT ora_fine FROM appuntamenti where pri_key = '{$data['orario']}'"
);

$eventuali_altre_date_luoghi_orari = sqlValue(
"SELECT piu_date_luoghi_orari FROM appuntamenti where pri_key = '{$data['altre_date_luoghi_orari']}'"
);

$e_mail_informazioni = sqlValue(
"SELECT recapito_mail_info FROM appuntamenti where pri_key = '{$data['e_mail_per_info']}'"
);

$ente_appartenenza_partecipante = sqlValue(
"SELECT nome_ente FROM enti_partner where pri_key = '{$data['ente_di_appartenenza']}'"
);

@mail(
// mail recipient
// da aggiungere per recuperare in automatico l'indirizzo e-mail inserito nel campo e_mail_per_info,
"$e_mail_informazioni",

// subject
"Sulla Buona Strada - Notifica iscrizione evento",

// message
"Si trasmette notifica di nuova iscrizione all'evento $titolo_evento.\n\nDi seguito trovi i dati relativi al nuovo iscritto.\n\n".

"Evento: $titolo_evento\n".
"Data: $data_evento\n".
"Luogo: $dove_evento\n".
"Orario: dalle $orario_inizio_evento alle $orario_fine_evento\n".
"$eventuali_altre_date_luoghi_orari\n\n".
"PARTECIPANTE\n".
"Nome: {$data['nome']}\n".
"Cognome: {$data['cognome']}\n\n".
"Ente: $ente_appartenenza_partecipante {$data['ente_non_elencato_sopra']}\n\n".
"E-mail: {$data['recapito_email']}\n".
"Telefono: {$data['recapiti_telefonici']}\n\n\n".
"L'elenco degli iscritti agli appuntamenti da te gestiti è sempre visibile nell'area AGENDA-->APPUNTAMENTI del portale sullabuonastrada.org/governance\n\n".

// sender address
"From: [email protected]"

);
}

return TRUE;
}

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: The sender's email address is not displayed correctly by the recipient.

Post by jsetzer » 2020-04-19 18:45

Did you setup SMTP correctly in Admin settings? Using SMTP you can control the sender. Otherwise SENDMAIL will be used, probably configured by your provider
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply