Contact Form - Change "From" E-Mail
PermalinkI integrated a contact form in my C5 site - nothing special, just the basic C5 contact form and told C5 to send me an E-Mail whenever the form get's submitted. This works fine, but the E-Mail Adress sending me these mails looks like this "no-reply@domain.com" and I would love to be able to answer directly to the E-Mail of whom dropped me a line.
Is there a chance to make the "From"-Adress of those E-Mails the Adress of the "E-Mail Adress"-Input-Field?
$mh = Loader::helper('mail'); $mh->to( $this->recipientEmail ); $mh->from( $formFormEmailAddress ); $mh->replyto( $replyToEmailAddress ); $mh->addParameter('formName', $this->surveyName); $mh->addParameter('questionSetId', $this->questionSetId); $mh->addParameter('questionAnswerPairs', $questionAnswerPairs); $mh->load('block_form_submission'); $mh->setSubject(t('%s Anfrage des Kontaktformulars ', $this->surveyName)); //echo $mh->body.'<br>'; @$mh->sendMail();
Just go to your /config/site.php and add a line like this:
define('EMAIL_DEFAULT_FROM_ADDRESS', 'nameit@domain.tld');
http://www.concrete5.org/documentation/how-tos/developers/add-abili...
Hope it helps