Why is my C# SMTP email code failing in Visual Studio Code? #12440
Wm-M-Thompson
started this conversation in
General Discussions
Replies: 2 comments
-
The code was missing a Main function entry point. Once that is added, there is no error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
this is
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a suspicion that the problem I am having has something to do with Visual Studio Code rather than with the C# code itself. I have recently configured my Visual Studio Code IDE to compile and build a C# (Command Line Console App) project and solution. But the moment I add meaningful code, it fales to properly recognize simple classes. Here is the simple test code I am trying:
``using System;
using System.Net;
using System.Net.Mail;
using System.Net.WebSockets;
namespace SendEmailWIthGoogleSMTP
{
class Program
{
string fromMail ="REDACTED@gmail.com";
string password ="REDACTED";
}
But here is the problem. It complains that 'message' is not defined albeit it does not complain after I define it. I know that sounds confusing, so here is the screen shot.
Beta Was this translation helpful? Give feedback.
All reactions