added reply-to header to mails sent via contact form
This commit is contained in:
parent
932e7f3152
commit
fdf2f2c03f
@ -38,7 +38,9 @@ $mailContents = [
|
||||
'subject' => 'Diese Nachricht kam ueber das Kontaktformular von t-r.de',
|
||||
'bodyText' => implode("\n\n", $body),
|
||||
'fromAddress' => $general['notificationAddress'],
|
||||
'fromName' => 'Tobias Radloffs Kontaktformular'
|
||||
'fromName' => 'Tobias Radloffs Kontaktformular',
|
||||
'replyTo' => $_POST['email'],
|
||||
'name' => $_POST['name']
|
||||
];
|
||||
|
||||
try {
|
||||
|
||||
@ -64,6 +64,11 @@ function SendEmail($toAddress, $mailContents) {
|
||||
// recipient
|
||||
$mail->addAddress($toAddress);
|
||||
|
||||
// reply-to address
|
||||
if ( isset($mailContents['replyTo']) and isset($mailContents['name']) ) {
|
||||
$mail->addReplyTo($mailContents['replyTo'], $mailContents['name']);
|
||||
}
|
||||
|
||||
// content
|
||||
$mail->CharSet = 'UTF-8';
|
||||
if ( isset($mailContents['bodyHTML']) and $mailContents['bodyHTML'] != '' ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user