Re: Recommend a C or C++ code to send a basic email using the SMTP protocol
Quote:
Originally Posted by
Computer_Science
@2kaud do you know if getting the code to compile in VS IDE will also compile in a JNI implementation?
Sorry, no. I only use VS.
Re: Recommend a C or C++ code to send a basic email using the SMTP protocol
As far as I know, JNI stands for Java Native Interface. So, the question is: why would anybody need SMTP be coded in C/C++, when there must be lots of Java packages doing the same, but natural Java way?
Re: Recommend a C or C++ code to send a basic email using the SMTP protocol
Quote:
Originally Posted by
2kaud
Because VS IDE automatically sets up the required correct build environment and uses the correct options with cl to compile the program - whereas Netbeans IDE isn't.
@2kaud , I finally got the code above to compile using your pre-requisite header information and variables for the new c++ standard. I also am not using Netbeans IDE, instead I am using Microsoft Visual Studio. I also did not realize it was not a '.c' file but a '.cpp' file. After the code is compiled run the command "SENDMAIL.exe smtp.gmail.com [email protected] [email protected] message.txt"
<p>where I include text in the 'message.txt'.
<p> The result of the program is 'Sent message.txt as email message to [email protected]'
<p> but when I check my outbox and inbox the message sent from the c++ program is not there.
<p> I know that the program connects to the internet, because when I disconnect my wifi and run the program I get "Cannot find SMTP mail server smtp.gmail.com"
<p> What can I do now to test the email being sent?
<p> Finally shouldn't the c++ program include login(username,password) to authenticate with gmail? like the "PasswordAuthentication"-Session variable in this example: https://www.tutorialspoint.com/javam...mple_email.htm
Re: Recommend a C or C++ code to send a basic email using the SMTP protocol
Quote:
Originally Posted by
Igor Vartanov
As far as I know, JNI stands for Java Native Interface. So, the question is: why would anybody need SMTP be coded in C/C++, when there must be lots of Java packages doing the same, but natural Java way?
I needed this for an Android implementation as an alternate to not being able to find working library examples for the javamail example. Got the javamail working, but now I want to learn about the C/C++ implementation.