Anybody know about a working smtp email program WITH source ? What's wrong with this one ?
-
Hello I am looking for source (preferably Visual C++) to a SMTP mailer which works correctly. The email module for http:\\www.codeproject.com\internet\ipemailannc.asp does not seem to work, atleast in my modified version: I am posting the modified version (picked from parts of a program that I wrote) : Source: ----------------------- #include "stdafx.h" #include "baseheader.h" #define BUFFER_DEFAULT_SIZE 4096 #define CMD_BUFF 256 #define SMTP_DEFAULT_PORT 25 #define TARGET_ADDRESS "a@b.com" #define SOURCE_ADDRESS "c@d" #define DEFAULT_SUBJECT "Subz " #define DEFAULT_SERVER_ADD "mail.x.y" SmtpMsg msg; TCPServer srv; SOCKET ssmtp; char szBuffer[BUFFER_DEFAULT_SIZE]; //Buffer to get response from server bool setSmtpMessage(char*); int connectToSmtpSrv(void); bool sendSmtpAnnounce(void); bool init(void); bool quit(void); int _tmain(int argc, _TCHAR* argv[]) { init(); char szMessage[2048]={0}; printf("\nEnter the message body (Hello World) \n"); fflush(stdin); scanf("%[^\n\r]",szMessage); if(*szMessage==0) { lstrcpy(szMessage,"Hello World"); } setSmtpMessage (szMessage); initConn(srv.address, srv.port, &ssmtp); sendSmtpAnnounce(); quit(); return 0; } bool init(void) { char* pszFrom,*pszTo,*pszMailServer; pszMailServer=new char[257]; pszFrom=new char[257]; pszTo=new char[257]; *pszFrom=0; *pszTo=0; *pszMailServer=0; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszTo); if(*pszTo==0) { msg.ToAdd = TARGET_ADDRESS; delete[] pszTo; } else msg.ToAdd = pszTo; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszFrom); if(*pszFrom==0) { msg.FromAdd = SOURCE_ADDRESS; delete[] pszFrom; } else msg.FromAdd = pszFrom; //Here define the subject of the announcement msg.Subject = new char[CMD_BUFF]; strcpy(msg.Subject, DEFAULT_SUBJECT); strcat(msg.Subject, getNowTime()); printf("\nEnter the mail server : "); fflush(stdin); scanf("%[^\n\r]",pszMailServer); if(*pszMailServer==0) { srv.address = DEFAULT_SERVER_ADD; delete[] pszMailServer; } else srv.address = pszMailServer; srv.port = SMTP_DEFAULT_PORT; return true; } bool quit(void) { closeConn(ssmtp); return true; } bool setSmtpMessage (char* body) { msg.MsgBody = body; return true; } bool sendSmtpAnnounce (void) { char Data2Srv[BUFFER_DEFAULT_SIZE]; char FeedBack[BUFFER_DEFAULT_SIZE]; char* CRLF = "\r\n";
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiri -
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiriOuch. :) --------------------------- He who knows that enough is enough will always have enough. -Lao Tsu
-
Hello I am looking for source (preferably Visual C++) to a SMTP mailer which works correctly. The email module for http:\\www.codeproject.com\internet\ipemailannc.asp does not seem to work, atleast in my modified version: I am posting the modified version (picked from parts of a program that I wrote) : Source: ----------------------- #include "stdafx.h" #include "baseheader.h" #define BUFFER_DEFAULT_SIZE 4096 #define CMD_BUFF 256 #define SMTP_DEFAULT_PORT 25 #define TARGET_ADDRESS "a@b.com" #define SOURCE_ADDRESS "c@d" #define DEFAULT_SUBJECT "Subz " #define DEFAULT_SERVER_ADD "mail.x.y" SmtpMsg msg; TCPServer srv; SOCKET ssmtp; char szBuffer[BUFFER_DEFAULT_SIZE]; //Buffer to get response from server bool setSmtpMessage(char*); int connectToSmtpSrv(void); bool sendSmtpAnnounce(void); bool init(void); bool quit(void); int _tmain(int argc, _TCHAR* argv[]) { init(); char szMessage[2048]={0}; printf("\nEnter the message body (Hello World) \n"); fflush(stdin); scanf("%[^\n\r]",szMessage); if(*szMessage==0) { lstrcpy(szMessage,"Hello World"); } setSmtpMessage (szMessage); initConn(srv.address, srv.port, &ssmtp); sendSmtpAnnounce(); quit(); return 0; } bool init(void) { char* pszFrom,*pszTo,*pszMailServer; pszMailServer=new char[257]; pszFrom=new char[257]; pszTo=new char[257]; *pszFrom=0; *pszTo=0; *pszMailServer=0; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszTo); if(*pszTo==0) { msg.ToAdd = TARGET_ADDRESS; delete[] pszTo; } else msg.ToAdd = pszTo; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszFrom); if(*pszFrom==0) { msg.FromAdd = SOURCE_ADDRESS; delete[] pszFrom; } else msg.FromAdd = pszFrom; //Here define the subject of the announcement msg.Subject = new char[CMD_BUFF]; strcpy(msg.Subject, DEFAULT_SUBJECT); strcat(msg.Subject, getNowTime()); printf("\nEnter the mail server : "); fflush(stdin); scanf("%[^\n\r]",pszMailServer); if(*pszMailServer==0) { srv.address = DEFAULT_SERVER_ADD; delete[] pszMailServer; } else srv.address = pszMailServer; srv.port = SMTP_DEFAULT_PORT; return true; } bool quit(void) { closeConn(ssmtp); return true; } bool setSmtpMessage (char* body) { msg.MsgBody = body; return true; } bool sendSmtpAnnounce (void) { char Data2Srv[BUFFER_DEFAULT_SIZE]; char FeedBack[BUFFER_DEFAULT_SIZE]; char* CRLF = "\r\n";
Search google for blat Systems AXIS Ltd - Software for Business ...
-
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiriLOL !! Unexpected !! Regardz Colin J Davies
*** WARNING *
This could be addictive
**The minion's version of "Catch :bob: "It's a real shame that people as stupid as you can work out how to use a computer. said by Christian Graus in the Soapbox
-
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiri:laugh: Never comment ur code. If it was hard to write, it should be hard to understand !!!
-
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiriHow did you do that hiding the real URL ? :wtf: Maxwell Chen
-
How did you do that hiding the real URL ? :wtf: Maxwell Chen
Maxwell Chen wrote: How did you do that hiding the real URL ? Real url is not hidden. It is redirected to the image file from that url. It uses free service provided by babyurl[^] which converts any long URL to a short one. Click here for new link showing same image using babyurl service[^] Never comment ur code. If it was hard to write, it should be hard to understand !!!
-
Maxwell Chen wrote: How did you do that hiding the real URL ? Real url is not hidden. It is redirected to the image file from that url. It uses free service provided by babyurl[^] which converts any long URL to a short one. Click here for new link showing same image using babyurl service[^] Never comment ur code. If it was hard to write, it should be hard to understand !!!
Thanks! It's interesting. :-D Maxwell Chen
-
The answer is available here[^]. :)
To those who didn't make it, we will remember you. To those who did :bob: is back. - Megan Forbes in Black Friday
Another Post by NnamdiOnyeyiriNice picture anyway. Got it... :) Cheers Kamal "God then made two great lights; the greater light to rule the day, and the less light to rule the night" - Genesis 47:3
-
Hello I am looking for source (preferably Visual C++) to a SMTP mailer which works correctly. The email module for http:\\www.codeproject.com\internet\ipemailannc.asp does not seem to work, atleast in my modified version: I am posting the modified version (picked from parts of a program that I wrote) : Source: ----------------------- #include "stdafx.h" #include "baseheader.h" #define BUFFER_DEFAULT_SIZE 4096 #define CMD_BUFF 256 #define SMTP_DEFAULT_PORT 25 #define TARGET_ADDRESS "a@b.com" #define SOURCE_ADDRESS "c@d" #define DEFAULT_SUBJECT "Subz " #define DEFAULT_SERVER_ADD "mail.x.y" SmtpMsg msg; TCPServer srv; SOCKET ssmtp; char szBuffer[BUFFER_DEFAULT_SIZE]; //Buffer to get response from server bool setSmtpMessage(char*); int connectToSmtpSrv(void); bool sendSmtpAnnounce(void); bool init(void); bool quit(void); int _tmain(int argc, _TCHAR* argv[]) { init(); char szMessage[2048]={0}; printf("\nEnter the message body (Hello World) \n"); fflush(stdin); scanf("%[^\n\r]",szMessage); if(*szMessage==0) { lstrcpy(szMessage,"Hello World"); } setSmtpMessage (szMessage); initConn(srv.address, srv.port, &ssmtp); sendSmtpAnnounce(); quit(); return 0; } bool init(void) { char* pszFrom,*pszTo,*pszMailServer; pszMailServer=new char[257]; pszFrom=new char[257]; pszTo=new char[257]; *pszFrom=0; *pszTo=0; *pszMailServer=0; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszTo); if(*pszTo==0) { msg.ToAdd = TARGET_ADDRESS; delete[] pszTo; } else msg.ToAdd = pszTo; printf("\nEnter the mail address : "); fflush(stdin); scanf("%[^\n\r]",pszFrom); if(*pszFrom==0) { msg.FromAdd = SOURCE_ADDRESS; delete[] pszFrom; } else msg.FromAdd = pszFrom; //Here define the subject of the announcement msg.Subject = new char[CMD_BUFF]; strcpy(msg.Subject, DEFAULT_SUBJECT); strcat(msg.Subject, getNowTime()); printf("\nEnter the mail server : "); fflush(stdin); scanf("%[^\n\r]",pszMailServer); if(*pszMailServer==0) { srv.address = DEFAULT_SERVER_ADD; delete[] pszMailServer; } else srv.address = pszMailServer; srv.port = SMTP_DEFAULT_PORT; return true; } bool quit(void) { closeConn(ssmtp); return true; } bool setSmtpMessage (char* body) { msg.MsgBody = body; return true; } bool sendSmtpAnnounce (void) { char Data2Srv[BUFFER_DEFAULT_SIZE]; char FeedBack[BUFFER_DEFAULT_SIZE]; char* CRLF = "\r\n";
Programming questions? In the LOUNGE???? Oh my, how you have offended me sir. Good day to you.
Glano perictu com sahni delorin!