ํ๋ก ํธ ์๋์์ ๋ฌธ์ ์์์ ์ ์ถํ์ฌ nodejs ์ฑ์ SendGrid์ ํตํฉํ๋ ค๊ณ ํฉ๋๋ค.
๊ทธ๋์ from
๋ฉ์ผ์ ์ด๋ค ๊ฒ์ด ๋ ๋ ์ ์์ต๋๋ค
๊ทธ๋ฆฌ๊ณ to
๊ฐ ๋์
๋๋ค.
๊ทธ๋ฆฌ๊ณ ์ด ๋ฉ์์ง๋ฅผ ๋ฐ์์ต๋๋ค
sendGrid.setApiKey(process.env.MY_SENDGRID_API_KEY);
const msg = {
to: '[email protected],
from: "[email protected]",
subject: 'Sending with SendGrid is Fun',
text: message,
html: `<strong>${name} is trying to get in touch with you!</strong>`,
};
return sendGrid.send(msg);
"message": "The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements",
์ด ์ฌ์ฉ ์ฌ๋ก๋ ์ง์๋์ง ์์ต๋๋ค. ๋ณด๋ธ ์ฌ๋์ ํ์ธ ๋ ๋ณด๋ธ ์ฌ๋ ID ์ฌ์ผํฉ๋๋ค. https://sendgrid.com/docs/for-developers/sending-email/sender-identity/
ํธ์ ๋ด์ ๊ฐ๊ธฐ
๋ณด๋ธ ์ฌ๋์ธ ๋ฉ์ผ์ ํ์ธํด์ผํฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ๋ค์๊ณผ ๊ฐ์ด ํด๊ฒฐํ์ต๋๋ค.
์ฌ๊ธฐ๋ก ๊ฐ์ญ์์ค :
์ค์ -> ๋ฐ์ ์ ์ธ์ฆ -> ๋จ์ผ ๋ฐ์ ์ ํ์ธ -> ์ฃผ์ ํ์ธ
๊ทธ ํ ์ค๋ฅธ์ชฝ์ ์์์ ์์ฑํ๊ณ ๋ฐ์ ์ ๋ฉ์ผ ํ์ธ์ ์๋ฃํ์ญ์์ค.
ํธ์ ๋ด์ ๊ฐ๊ธฐ
๋จ์ผ ๋ฐ์ ์ ํ์ธ์ ์ฑ๊ณต์ ์ผ๋ก ์๋ฃํ์ง๋ง ์ฌ์ ํ์ด ์ค๋ฅ๊ฐ ๋ฐ์ํฉ๋๋ค!
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ณด๋ธ ์ฌ๋์ธ ๋ฉ์ผ์ ํ์ธํด์ผํฉ๋๋ค. ์ด ๋ฌธ์ ๋ฅผ ๋ค์๊ณผ ๊ฐ์ด ํด๊ฒฐํ์ต๋๋ค.
์ฌ๊ธฐ๋ก ๊ฐ์ญ์์ค :
์ค์ -> ๋ฐ์ ์ ์ธ์ฆ -> ๋จ์ผ ๋ฐ์ ์ ํ์ธ -> ์ฃผ์ ํ์ธ
์
๊ทธ ํ ์ค๋ฅธ์ชฝ์ ์์์ ์์ฑํ๊ณ ๋ฐ์ ์ ๋ฉ์ผ ํ์ธ์ ์๋ฃํ์ญ์์ค.
์ฌ๊ธฐ์์ ์์ธํ ๋ด์ฉ์ ์ฝ์ ์ ์์ต๋๋ค.