question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Send email using my SMTP Server

See original GitHub issue

Hi, I tried to send an email using my SMTP Server to any gmail account, but couldn’t. I’m using this code

            MailMessage mailMessage = new MailMessage();
            mailMessage.From = new MailAddress("test@test.com");
            mailMessage.To.Add("nour.alsabbagh1@gmail.com");
            mailMessage.Subject = "subject";

            mailMessage.Body = "body";
            mailMessage.IsBodyHtml = true;

            SmtpClient smtpClient = new SmtpClient("localhost", 25);
            smtpClient.UseDefaultCredentials = true;
            smtpClient.Send(mailMessage);

The listener is receiving the message and is handeling it.

image

But unfortunately the gmail account is not receiving the message. Did I use it wrongly?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
mauricelcommented, Nov 21, 2019

All this library does is receive email. It doesn’t onforward it for you. You can extend this library to do that for you.

See also: https://github.com/cosullivan/SmtpServer/issues/89

0reactions
nsabbaghcommented, Nov 21, 2019

Alright, Thank you so much

Read more comments on GitHub >

github_iconTop Results From Across the Web

SMTP: Servers and Sending Emails | Twilio SendGrid
For example, the SMTP server Gmail uses is smtp.gmail.com, and Twilio SendGrid's is smtp.sendgrid.com. You can generally find your SMTP email ...
Read more >
Send Emails with SMTP [2023 Guide with Code Examples]
The easiest and most popular way to send emails with SMTP in PHP is through PHPMailer. It's compatible with PHP 5.5 and higher....
Read more >
How to Use the Gmail SMTP Server to Send Emails for Free
As we detailed above, the default server address is smtp.gmail.com. You can log in using your full Gmail email address and your Google...
Read more >
How to Send Emails Using Google SMTP Server
How to Use Google SMTP Server? ; Gmail SMTP server: smtp.gmail.com ; Gmail SMTP password: Your Gmail password. ; Gmail SMTP port: 465...
Read more >
Set up SMTP for Sending Email from Your email Address
How to enable SMTP Email Feature · 1. Click on the ' Activate' Button next to SMTP Feature. · 2. After activating, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found