# I am not receiving email notifications. I integreted the email.jsw, sendGrid.js and the main page code. Please help.

**URL:** <https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [September 25, 2018, 5:39pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555 "2018-09-25T17:39:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![infogloravel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/infogloravel/32/6432_2.png) [@infogloravel](https://forum.wixstudio.com/u/infogloravel)\
**Post date:** [September 25, 2018, 5:39pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/1 "2018-09-25T17:39:56Z")

</div>



---

<div class="post-metadata">

**Author:** ![\_or](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/_or/32/1004_2.png) [@\_or](https://forum.wixstudio.com/u/_or)\
**Post date:** [September 26, 2018, 1:02pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/2 "2018-09-26T13:02:18Z")

</div>

Hi,  
What are you trying to achieve? please share the code you are using so we can inspect.

---

<div class="post-metadata">

**Author:** ![dulgerburcu](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dulgerburcu](https://forum.wixstudio.com/u/dulgerburcu)\
**Post date:** [November 23, 2018, 12:20pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/3 "2018-11-23T12:20:31Z")

</div>

Hi,  
i am trying to send email with sendgrid api key.  
I can’t send mail my personal email from my website.  
i got the api code .Please help.

[//email.jsw](https://email.jsw)  
import {sendWithService} from ‘backend/sendGrid’;  
export function sendEmail(subject, body) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsTXsk”;//my new API key  
const sender = “[info@mydomain.com](mailto:info@mydomain.com)”;//my personal email  
const recipient = “[to.email@domain.com](mailto:to.email@domain.com)”;  
return sendWithService(key, sender, recipient, subject, body);  
}  
export function sendEmailWithRecipient(subject, body,recipient) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsTXsk”;  
const sender = “[info@mydomain.com](mailto:info@mydomain.com)”;//my personal email  
return sendWithService(key, sender, recipient, subject, body);  
}

[//SendGrid.js](https://SendGrid.js)  
// I didn’t change anything here

import {fetch} from ‘wix-fetch’;  
export function sendWithService(key, sender, recipient, subject, body) {  
const url = “[https://api.sendgrid.com/api/mail.send.json](https://api.sendgrid.com/api/mail.send.json)”;  
const headers = {  
“Authorization”: "Bearer " + key,  
“Content-Type”: “application/x-www-form-urlencoded”  
};  
const data = `from=${sender}&to=${recipient}&subject=${subject}&text=${body}`;  
const request = {  
“method”: “post”,  
“headers”: headers,  
“body”: data  
};  
return fetch(url, request)  
.then(response =\> response.json());  
}

---

<div class="post-metadata">

**Author:** ![dulgerburcu](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dulgerburcu](https://forum.wixstudio.com/u/dulgerburcu)\
**Post date:** [November 23, 2018, 12:21pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/4 "2018-11-23T12:21:02Z")

</div>

Hi,  
i am trying to send email with sendgrid api key.  
I can’t send mail my personal email from my website.  
i got the api code .Please help.  
[//email.jsw](https://email.jsw/)  
import {sendWithService} from ‘backend/sendGrid’;  
export function sendEmail(subject, body) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsTXsk”;//my new API key  
const sender = "info@mydomain.com ";//my personal email  
const recipient = "to.email@domain.com ";  
return sendWithService(key, sender, recipient, subject, body);  
}  
export function sendEmailWithRecipient(subject, body,recipient) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsTXsk”;  
const sender = "info@mydomain.com ";//my personal email  
return sendWithService(key, sender, recipient, subject, body);  
}  
[//SendGrid.js](https://sendgrid.js/)  
// I didn’t change anything here  
import {fetch} from ‘wix-fetch’;  
export function sendWithService(key, sender, recipient, subject, body) {  
const url = " [https://api.sendgrid.com/api/mail.send.json](https://api.sendgrid.com/api/mail.send.json) ";  
const headers = {  
“Authorization”: "Bearer " + key,  
“Content-Type”: “application/x-www-form-urlencoded”  
};  
const data = `from=${sender}&to=${recipient}&subject=${subject}&text=${body}`;  
const request = {  
“method”: “post”,  
“headers”: headers,  
“body”: data  
};  
return fetch(url, request)  
.then(response =\> response.json());  
}

---

<div class="post-metadata">

**Author:** ![roi-bendet](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/roi-bendet/32/1283_2.png) [@roi-bendet](https://forum.wixstudio.com/u/roi-bendet)\
**Post date:** [November 25, 2018, 4:35pm UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/5 "2018-11-25T16:35:54Z")

</div>

Hi, Do you received and error in the console?  
Roi.

---

<div class="post-metadata">

**Author:** ![dulgerburcu](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@dulgerburcu](https://forum.wixstudio.com/u/dulgerburcu)\
**Post date:** [November 30, 2018, 9:45am UTC](https://forum.wixstudio.com/t/i-am-not-receiving-email-notifications-i-integreted-the-email-jsw-sendgrid-js-and-the-main-page-code-please-help/4555/6 "2018-11-30T09:45:36Z")

</div>

i solve this problem.i changed all of the emails and i just made my own email adress.

[//email.jsw](https://email.jsw/)  
import {sendWithService} from ‘backend/sendGrid’;  
export function sendEmail(subject, body) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsT”;//my new API key  
const sender = **"info@mydomain.com**  **";** //my personal email  
const recipient = **"**  **info@mydomain.com**  **"** ;  
return sendWithService(key, sender, recipient, subject, body);  
}  
export function sendEmailWithRecipient(subject, body,recipient) {  
const key = “SG.rTZdkPkjTYqhey10RpPZXg.QVLM0mOrPxMu0ZuyG2o9i5MCIUNHkQeTE\_NUFhsT”;  
const sender = **"info@mydomain.com**  **"** ;//my personal email  
return sendWithService(key, sender, recipient, subject, body);  
}

But i have a new problem about sending email.I created a new form elated to sending an email.  
In this js. code i wrote a mail that hotmail or gmail form is sending success.

$w.onReady( function () {  
//TODO: write your page related code here…

});

import { sendEmail, sendEmailWithRecipient } from ‘backend/email’;

$w.onReady( function () {  
$w(“#button3”).onClick(sendFormData);  
});

function sendFormData() {

const subject = `Information Form`;  
const body = `${$w("#input8").value}...`;  
const recipient = “[info@mydomain.com](mailto:info@mydomain.com)”;  
sendEmailWithRecipient(subject, body, recipient)  
.then(response =\> console.log(response));  
sendEmail(subject, body)  
.then(response =\> console.log(response));  
**}**  
But i have a new problem about sending email.I created a new form related to sending an email.This code, sending a mail with hotmail or gmail successed.But my domain’s email not sending.  
I wonder if the mail settings have trouble ?

Note: mail sending does not receive an error.
