but config says [email protected]
What Laravel version is this?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am new to using ses driver on my laravel project. I tried following the guide to implement the ses through here:
https://medium.com/@martin.riedweg/configure-amazon-ses-on-laravel-5-8-in-5-minutes-764c30df6399
I managed to configure everything. This is my .env:
MAIL_DRIVER=ses
MAIL_HOST=email–smtp.ap-south–1.amazonaws.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=password
MAIL_ENCRYPTION=tls
AWS_ACCESS_KEY_ID=xxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxx
AWS_DEFAULT_REGION=ap-south-1
AWS_BUCKET=
I have created a mailable too like this:
InvoiceAndReceiptEmail.php:
class InvoiceAndReceiptEmail extends Mailable
{
use Queueable, SerializesModels;
public $purchase;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(Purchase $purchase)
{
$this->purchase = $purchase;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->subject(' Order Confirmation - ' . $this->purchase->getFormattedNumber())
->view('emails.purchases.invoice-receipt-email')
->with('purchase', $this->purchase)
->attach(public_path(
'/storage/documents/invoice/' . $this->purchase->purchase_number . '/' . $this->purchase->purchase_number . '.pdf'
))
->attach(public_path(
'/storage/documents/invoice/' . $this->purchase->purchase_number . '/' . $this->purchase->purchase_number . '-receipt.pdf'
));
}
}
In my email queue:
class SendInvoiceAndReceiptEmail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $emailAddress;
public $purchase;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($emailAddress, $purchase)
{
$this->emailAddress = $emailAddress;
$this->purchase = $purchase;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$emailInstance = new InvoiceAndReceiptEmail($this->purchase);
Mail::to($this->emailAddress)->send($emailInstance);
}
}
While I received the email and it works, but the sender email is from [email protected] and I am expecting it to be from [email protected].
The email should be sent through the ses and the aws access key and secret key should be the identifier to the domain email created.
May I know why is it not working?
Did I overlook something?
Please or to participate in this conversation.