Skip to content

Commit

Permalink
Add parameter for raw message encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Zahariev committed Sep 26, 2017
1 parent e82ef20 commit 6b69aef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/SimpleEmailServiceMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ public function hasInlineAttachments()
/**
* Get the raw mail message
*
* @param bool $encode Should the raw message be base64 encoded or not
* @return string
*/
public function getRawMessage()
public function getRawMessage($encode = true)
{
$boundary = uniqid(rand(), true);
$raw_message = count($this->customHeaders) > 0 ? join("\n", $this->customHeaders) . "\n" : '';
Expand Down Expand Up @@ -367,7 +368,7 @@ public function getRawMessage()

$raw_message .= "\n--{$boundary}--\n";

return base64_encode($raw_message);
return $encode ? base64_encode($raw_message) : $raw_message;
}

/**
Expand Down

0 comments on commit 6b69aef

Please sign in to comment.