Skip to content

Commit

Permalink
Fix e-mail problem of not adding the 'from' address
Browse files Browse the repository at this point in the history
  • Loading branch information
dleffler committed Apr 26, 2011
1 parent a15cb38 commit e2f1d46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions framework/core/subsystems/expMail.php
Expand Up @@ -242,14 +242,18 @@ public function quickSend($params=array()) {
}

$this->addTo($params['to']);
if ( !empty($params['from'])) {
if (stristr('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$', $params['from'])) {
$this->addFrom = $params['from'];
}
if (!empty($params['from'])) {
// if (stristr('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$', $params['from'])) {
if (empty($params['from_name'])) {
$this->addFrom($params['from']);
} else {
$this->addFrom($params['from'],$params['from_name']);
}
// }
}

if (!empty($params['subject'])) $this->subject($params['subject']);
if (!empty($params['headers'])) $this->addHeaders($params['headers']);
if (!empty($params['headers'])) $this->addHeaders($params['headers']);
if (!empty($params['html_message'])) $this->addHTML($params['html_message']);
if (!empty($params['text_message'])) $this->addText($params['text_message']);

Expand Down
2 changes: 1 addition & 1 deletion modules/formbuilder/actions/submit_form.php
Expand Up @@ -135,7 +135,7 @@
'html_message'=>$emailHtml,
"text_message"=>$emailText,
'to'=>trim($address),
'from'=>$from,
'from'=>trim($from),
'from_name'=>$from_name,
'subject'=>$f->subject,
));
Expand Down

0 comments on commit e2f1d46

Please sign in to comment.