I am having an issue with GMAIL SMTP in a C# program

Discussion in 'Programming' started by xarzu, Nov 22, 2024.

  1. #1
    I want to use C# do to a necessary mass emailing of hundreds of receiving email addresses. I have a gmail account and I believe my message will be better received if it comes from my personal gmail account instead of from one of my website's email accounts. But if I do not resolve this issue, I might resort to trying something else.

    A youtube tutorial for setting up a C# program for sending GMail messages has instructed me to first set up two tier authentication. So I did that. Then this tutorial suggested that I use a special feature in the Google Account Settings of creating an App ID with a unique 16 character special password. If you like, I can add more specifics and content about this and post a link to the youtube tutorial.

    It did not work and the line of code where, after I set up the parameters of a message, I use the SMTP command to send the message an error is thrown.

    It almost seems that there is so much security protocols surrounding GMail now that Google has made it virtually impossible for someone to write a C# program to make tasks easier.

    On the other hand, I have an active Email server, Thunderbird, that I use. So there must be a correct way to use Gmail in a desktop App and I assume a software developer can write a program to do what I am wanting to accomplish.
     
    xarzu, Nov 22, 2024 IP
  2. GreenHost.Cloud

    GreenHost.Cloud Active Member

    Messages:
    473
    Likes Received:
    34
    Best Answers:
    3
    Trophy Points:
    73
    #2
    Google has definitely tightened things up to keep accounts safe. If you're open to it, I’d be happy to help troubleshoot the C# code you’re working with or maybe explore some alternative solutions that still allow you to leverage your existing email setup.
     
    GreenHost.Cloud, Nov 24, 2024 IP
  3. thomas3456

    thomas3456 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    I'm having trouble configuring Gmail SMTP in my C# application. Despite using the correct SMTP settings (smtp.gmail.com, port 587, SSL enabled), I keep encountering errors when attempting to send emails. I’ve enabled "Less secure apps" in Gmail and verified my credentials, but the issue persists. Could someone guide me through troubleshooting this issue or offer any suggestions for properly configuring Gmail SMTP in C#?
     
    thomas3456, Dec 13, 2024 IP
  4. MivoCloud

    MivoCloud Greenhorn

    Messages:
    56
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    8
    #4
    Hi, as a person who wrote programs in C# (I did it for personal pleasure :D) I can give you a hint. Write to me in DM and I will help you in any way I can, I somehow set everything up and everything worked like clockwork, I can search for information among the programs.
     
    MivoCloud, Jan 9, 2025 IP