Re: how to send mails from VC++ program without using outlook
"Please note that as of v2.70, the code is now for Visual C++ 2005 or later. I will not be supporting VC 6 anymore for this code, so please don't email me requesting this<gg>. Remember VC 6 is now a ten year old compiler. It's now time to upgrade to VC 2005 or VC 2008!"
Maybe someone can share the V2.70 or earlier edition while the author stopped providing aged releases.
Re: how to send mails from VC++ program without using outlook
I use this send mail vc++ code but it gives error error during call to recv<> reply:-1 - 10054 and remaing all lines.so give me solution,exactly what is the problem
Re: how to send mails from VC++ program without using outlook
I'm an old VB6 guy working my way through MSVC. At 56, it's hard to assimilate enough to write MSVC effectively before I'm retirement age! Your generous and cooperative attitude will help more people than you know. Thank you so much.
Hello. When I run the program I get an error message like this. I would be glad if you help. Thank you in advance.
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|10|warning: ignoring #pragma comment |
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|13|error: ISO C++ forbids declaration of 'VERSION_MAJOR' with no type|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|14|error: ISO C++ forbids declaration of 'VERSION_MINOR' with no type|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'void ShowUsage()':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|20|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|20|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'void Check(int, char*)':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|32|error: 'cerr' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|32|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'int main(int, char**)':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|60|error: 'ifstream' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|60|error: expected ';' before 'MsgFile'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|65|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|65|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|74|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|74|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|83|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|83|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|105|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|105|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|111|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|115|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|116|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|120|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|121|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|125|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|126|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|130|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|131|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|134|error: 'MsgFile' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|139|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|145|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|146|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|150|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|151|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|154|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|154|error: 'endl' was not declared in this scope|
||=== Build finished: 19 errors, 15 warnings (0 minutes, 0 seconds) ===|
Hello. When I run the program I get an error message like this. I would be glad if you help. Thank you in advance.
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|10|warning: ignoring #pragma comment |
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|13|error: ISO C++ forbids declaration of 'VERSION_MAJOR' with no type|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|14|error: ISO C++ forbids declaration of 'VERSION_MINOR' with no type|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'void ShowUsage()':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|20|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|20|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'void Check(int, char*)':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|32|error: 'cerr' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|32|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp||In function 'int main(int, char**)':|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|60|error: 'ifstream' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|60|error: expected ';' before 'MsgFile'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|65|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|65|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|74|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|74|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|83|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|83|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|105|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|105|error: 'endl' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|111|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|115|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|116|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|120|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|121|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|125|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|126|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|130|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|131|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|134|error: 'MsgFile' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|139|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|145|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|146|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|150|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|151|warning: deprecated conversion from string constant to 'char*'|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|154|error: 'cout' was not declared in this scope|
C:\Users\Hkn\Desktop\calisma\fb\main.cpp|154|error: 'endl' was not declared in this scope|
||=== Build finished: 19 errors, 15 warnings (0 minutes, 0 seconds) ===|
last right, then the error message as follows;
C: \ Users \ HKN \ Desktop \ working \ fb \ main.cpp | 11 | warning: ignoring # pragma comment |
C: \ Users \ HKN \ Desktop \ working \ fb \ main.cpp | 14 | error: ISO C + + forbids declaration of 'VERSION_MAJOR' with no type |
C: \ Users \ HKN \ Desktop \ working \ fb \ main.cpp | 15 | error: ISO C + + forbids declaration of 'VERSION_MINOR' with no type |
Re: how to send mails from VC++ program without using outlook
I m writting an application which calulates some results and send them thr e-mail.I want my VC++ program to send this mail to specified address without using Outlook Express or Microsoft Outlook...So You try to this link htttp://www.coolinterview.com
// Create input stream for reading email message file
string dir = "D:\\file.txt";
ifstream MsgFile(dir);
// Attempt to intialize WinSock (1.1 or later)
if(WSAStartup(MAKEWORD(VERSION_MAJOR, VERSION_MINOR), &WSData))
{
cout << "Cannot find Winsock v" << VERSION_MAJOR << "." << VERSION_MINOR << " or later!" << endl;
return 1;
}
// Lookup email server's IP address.
lpHostEntry = gethostbyname(szSmtpServerName);
if(!lpHostEntry)
{
cout << "Cannot find SMTP mail server " << szSmtpServerName << endl;
return 1;
}
// Create a TCP/IP socket, no specific protocol
hServer = socket(PF_INET, SOCK_STREAM, 0);
if(hServer == INVALID_SOCKET)
{
cout << "Cannot open mail server socket" << endl;
return 1;
}
// Get the mail service port
lpServEntry = getservbyname("mail", 0);
// Use the SMTP default port if no other port is specified
if(!lpServEntry)
iProtocolPort = htons(IPPORT_SMTP);
else
iProtocolPort = lpServEntry->s_port;
//iProtocolPort = 587;
// Send all lines of message body (using supplied text file)
MsgFile.getline(szLine, sizeof(szLine)); // Get first line
do // for each line of message text...
{
sprintf(szMsgLine, "%s%s", szLine, CRLF);
Check(send(hServer, szMsgLine, strlen(szMsgLine), 0), "send() message-line");
MsgFile.getline(szLine, sizeof(szLine)); // get next line.
} while(MsgFile.good());
// Send blank line and a period
sprintf(szMsgLine, "%s.%s", CRLF, CRLF);
Check(send(hServer, szMsgLine, strlen(szMsgLine), 0), "send() end-message");
Check(recv(hServer, szBuffer, sizeof(szBuffer), 0), "recv() end-message");
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.