Backend email sending

Hi,
I use this backend function:
//email.jsw

import {sendWithService} from ‘backend/sendGrid’;

export function sendEmail(subject, body) {
const key = “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”;
const sender = “ibmretraitesqc@gmail.com”;
const recipient = “ibmretraitesqc@gmail.com”;
return sendWithService(key, sender, recipient, subject, body);
}
If I put the same email address for the sender and the recipient, it doesn’t get to the recipient. I put a different recipient email address, it gets there.

Is there a way to force the sending even if it is the same email address then the sender?

Thank you!

Pierre Lacasse
Ibmretraitesqc@gmail.com

Using this tutorial.
https://support.wix.com/en/article/corvid-tutorial-sending-an-email-on-form-submission

If you read the tutorial page carefully and completely, then you will see that the page clearly states:
The code we wrote above sends an email to the same address each time the form is submitted.
It can easily be used as a basis for other common situations.

So, if you are just using that part of the code you are simply sending from the sender email always to the to email, this will never change.

Basically, if you put in the same email address like you have, then you will just send from that email and then receive the same email back to that email too.

If you are wanting it to send from your own sender email and then be sent to another email that changes, then you need to add the code that is listed underneath the modifying your code section in that same tutorial.

I have used that exact tutorial and it has all worked fine on my site, plus there are two good videos about this that will walk you through the complete tutorial.
https://www.youtube.com/watch?v=bPd7o7hUfGk
https://www.youtube.com/watch?v=0SVvNKNEmWk

You can also use Wix Automations which involves a lot less code,
https://support.wix.com/en/ascend-by-wix/wix-automations

Or you can setup a triggered email to contacts or members instead.
https://support.wix.com/en/article/about-triggered-emails
https://support.wix.com/en/article/sending-automated-response-emails-to-contacts
https://support.wix.com/en/article/corvid-tutorial-sending-a-triggered-email-to-members

Also, if you stick with the SendGrid option, then I would make sure that you setup all your server and domain authentication too within SendGrid, so that you don’t get the set via SendGrid message on your mails and you are letting the email providers know that you are letting SendGrid send emails for you, so basically a way of white listing yourself so to speak.
https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/