Here we have a Windows Visual Studio C(++) session and Mac Xcode C(++) session (not respectively … just so that I can show you this video), each showing a method of sending a Google Gmail ( see Gmail Email Invitation Primer Tutorial ) email via a C program run via calls to the operating system.
Download C programming source code and rename to main.c as required, for a program you might like to call GmailEmailCommandLine maybe, and remember to plugin in your email account and its password where it currently has “rmetcalfe15@gmail.com passwordGoesHere” in the code (for Windows). This code shows cross-platform code so that the different operating system requirements are catered for by the one supervisory C code source ( ever heard of the term codebase? + we not only need to talk about Kevin, we need to talk about source control sometime? ) which can be used on either Xcode for a Mac or Visual Studio for a Windows computer where the Visual Studio C++ project is set up with the same approach as taken in the tutorial Oracle Pro*C Cursor Primer Tutorial to produce a C program.
Download VB.Net programming source code (for a Visual Studio VB.Net Console Application project) and rename to Module1.vb as required, and when compiled, using Visual Studio VB.Net, rename the resultant *.exe to SmtpGmailEmail.exe in the PATH of the computer ( via echo %PATH% (for Windows) or echo $PATH (for Mac Linux Bash) ) for it to be suitable to use with the C program above.
Okay, so that is the C supervisory approach. Alternatively, even easier script operating system supervisory approaches (where the C is no longer needed, but the VB.Net is still needed for Windows) are ( where the file[.nam] supports Subject: To: Cc: Bcc: syntaxes ):
- rem SmtpGmailEmail.bat for Windows ( placed on PATH ) supervises SmtpGmailEmail.exe ( placed on PATH )
- rem Usage: SmtpGmailEmail.exe emailer@gmail.com password c:afile.nam [emailto@whatever.huh] [emailcc@whatever.huh] [emailbcc@whatever.huh] [subject words]
- SmtpGmailEmail.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
- #!/bin/sh
- # SmtpGmailEmail.sh for Mac ( placed on PATH and chmod 777 SmtpGmailEmail.sh ) supervises sendmail
- if [ -f “$2” ]; then
- sendmail $1 < $2
- else
- echo Usage: $0 emailto@whatever.huh file.nam
- fi
Of interest would be smtp protocol information from Wikipedia.
If this was interesting you may be interested in this too.
7 Responses to Mac and Windows Gmail Email Supervised by C Primer Tutorial