Environment & Dependencies
Nodemailer is a Node.JS npm module for sending emails.
This has been the go to solution to most NodeJS ...
For further actions, you may consider blocking this person and/or reporting abuse
Not working internal style in html page
Really?
Let me see a snippet of your code
const welcomeEmailTemplate = (fullName) => {
return `
<!DOCTYPE html>
Social Space
<br>
@import url("<a href="https://fonts.googleapis.com/css2?family=Signika&display=swap%22" rel="nofollow">https://fonts.googleapis.com/css2?family=Signika&amp;display=swap&quot;</a>);</p>
<div class="highlight"><pre class="highlight plaintext"><code> :root {
--primary-color: #8344ff;
}
body {
margin: 0;
padding: 0;
font-family: "Signika", sans-serif;
}
h1 {
margin: 0;
color: var(--primary-color);
}
p {
margin: 0;
text-align: justify;
}
a {
text-decoration: none;
color: black;
}
a:hover {
color: var(--primary-color);
}
li::marker {
margin: 0;
}
img {
width: 100%;
max-height: 300px;
margin: 20px 0px;
}
.container {
padding: 25px;
border: 2px solid var(--primary-color);
border-radius: 15px;
}
</style>
</code></pre></div>
<p></head><br>
<body><br>
<div class="container"><br>
<h1>Your Space for Connecting and Sharing !</h1><br>
<br /><br>
<p>Hey, ${fullName} 👋🏻</p><br>
<img<br>
src="https://res.cloudinary.com/socialspace/image/upload/v1690739392/email-vectors/welcomeVector.svg"<br>
alt="welcome"<br>
/><br>
<p><br>
We are thrilled to extend a warm welcome to you as a new member of our<br>
ever-growing community at<br>
<a style="color: var(--primary-color)" href="">Social Space</a> !<br>
</p><br>
<br /><br>
<p><br>
Your decision to join Social Space brings us one step closer to building<br>
a vibrant online space where users like you can connect with friends,<br>
family, and like-minded individuals, sharing your thoughts, memories,<br>
and experiences with the world.<br>
</p><br>
<br /><br>
<p><br>
Here at Social Space, our mission is to create an inclusive environment<br>
that fosters meaningful interactions, celebrates diversity, and respects<br>
the privacy and security of all our users.<br>
</p><br>
<br /><br>
<p><br>
If you have any questions, concerns, or suggestions, please don't<br>
hesitate to reach out to our friendly support team at<br>
<a<br>
style="color: var(--primary-color)"<br>
href=""<br>
></a<br>
><br>
We're here to ensure that your experience on Social Space is as<br>
enjoyable as possible.<br>
</p><br>
<br /><br>
<p><br>
Once again, thank you for choosing <a style="color: var(--primary-color)" href="">Social Space</a>. We are genuinely<br>
excited to have you on board and cannot wait to see the positive impact<br>
you will make within our community.<br>
</p><br>
<br /><br>
<p>Best regards,</p><br>
<br /><br>
<p>The Social Space Team</p><br>
<li><a href="">Yogesh Zala</a></li><br>
<li><a href="">Hiren Prajapati</a></li><br>
</div><br>
</body><br>
</html><br>
`;<br>
};</p>
<p>module.exports = welcomeEmailTemplate;</p>
<p>async function sendWelcomeEmail(email, fullName) {<br>
const mailOptions = {<br>
from: <code>Social Space <${process.env.EMAIL}></code>,<br>
to: email,<br>
subject: "Welcome to Social Space ! 🖐🏻",<br>
html: welcomeEmailTemplate(fullName),<br>
};</p>
<p>await sendEmail(mailOptions);<br>
}</p>
The welcomeEmailTemplate looks fine and sould work.
Perhaps the issue will be your implementation. What error do you get?
Send me a mail let's take a close look at it😁
Thank You for response!
error not show any but styling is not show when i have sent email to someone only show content without styling....
Oh I see.
Did you use this👇👇
Yes, I have used!
support.google.com/mail/thread/476...
Please check the above Google support link! I think have you idea.
Okay sure
Very informative
Thank you
Am I crazy but this doesn't work without getting gmail api key?
This works fine without any API key.
How are you implementing it?
Thanks for the "Application-specific password required" error resolution
I am glad it helped
Hey, i'm using my actual emailId and emailPassword to send mails using nodemailer, with smpt.gmail.com as host, still i'm not able to send the mails and getting the error of false credentials. can anyone please explain me why i'm getting such error?
`const nodemailer = require("nodemailer");
require("dotenv").config();
const mailSender = async (email, title, body) => {
try{
// mail send krne ke liye transporter use hota h
let transporter = nodemailer.createTransport({
host: process.env.MAIL_HOST,
auth:{
user: process.env.MAIL_USER,
pass: process.env.MAIL_PASS,
}
});
// console.log(body);
// console.log(transporter);
}
module.exports = mailSender;`
above is my code snippet for mailSender
please can anyone tell me, where i'm doing it wrong?
You are not suppose to use your actual gmail password here.
Generate an APP password from your google account and use that instead
Bro my original mail is sent to the user. Not the 'from' one. Why is it so?
You original email is used for the SMTP config so it is what Gmail uses.
Is there any way to send an email via the from one?
You have to modify the password by going to the security section of gmail.