Originally posted by: Larry Reid
Unicode support. (Important to me but irrelevant to some)
The Unicode support was added quite easily. It required some changes in the get_response and all the parameters for Send had to be converted:
Here is a sample method:
BOOL CPOP3::Connect()
CString sUser;
if( m_bConnected )
if( !m_wsPOP3Server.Create() )
m_bConnected = TRUE;
Extracting files is a bit harder and required more changes. I am still working on some of the code, but I can extract any file that is base64 endcoded or quoted-printable. If you need some help, drop me a line. The code is not neat and tidy yet but it may serve as a starting point.
_________________________________________
This E-mail message reflects only the opinions of the author and is
Ok, first comes the "Thanx" to all the guys volunteering their time and code to make everybody's life a bit easier. Some comments on the POP3 class and the SMTP. I found the implementation of Wes Clyburn very good and it could serve as the basis for a nice Send and Receive application. Also a "Danke" to Michael Krebs, it was very useful and saved me lots of time. Now to the limitations that I had to overcome:
Extraction of files from MIME messages after downloading.(This seems like a biggy!!!)
Extra Encoding and decoding algorythms.
There is a problem that the comparing of strings is case insensitive in MIME, so that is fixed.
Please ensure that you include the <atlbase.h> header in the CPP.
{
USES_CONVERSION;
CString sPass;
return TRUE;
{
m_szError = _T( "Unable to create the socket." );
return FALSE;
}
if( !m_wsPOP3Server.Connect( GetServerHostName(), GetPort() ) )
{
m_szError = _T( "Unable to connect to server" );
m_wsPOP3Server.Close();
return FALSE;
}
if( !get_response( CONNECTION ) )
{
m_wsPOP3Server.Close();
return FALSE;
}
sUser.Format( _T("USER %s\r\n"), GetUsername());
m_wsPOP3Server.Send( T2A((LPTSTR)(LPCTSTR)sUser), sUser.GetLength() );
if( !get_response( IDENTIFICATION ) )
{
m_wsPOP3Server.Close();
return FALSE;
}
sPass.Format( _T("PASS %s\r\n"), GetPassword());
m_wsPOP3Server.Send( T2A((LPTSTR)(LPCTSTR)sPass), sPass.GetLength() );
if( !get_response( AUTHENTIFICATION ) )
{
m_wsPOP3Server.Close();
return FALSE;
}
return TRUE;
}
Lawrence P. Reid
Software Engineer
International Bureau of the Universal Postal Union
Weltpoststrasse 4
3000 Bern 15
Switzerland
Tel: +41 31 350 3541
Fax: +41 31 352 4323
e-mail: larry.reid@ib.upu.org
Web: http://postinfo.upu.org
in no way binding upon his or her employer.
Ce courrier ne refl�te que l'avis de l'auteur et
ne saurait engager la soci�t� pour laquelle il travaille.
Originally posted by: Peter Provost
There is a bug in DevStudio's ATL App Wizard which sets the release builds to be a console app.
Go to project settings for the release build. On the C/C++ tab make sure that _ATL_MIN_CRT is not defined. This causes it to link as if it were a console app, which means main() has to be defined. Just remove the symbol and it should be just fine.
ReplyOriginally posted by: ljp
You have to put the numeral 1 into the edit box labeled 'Message#'. It doesn't seem to display large messages....
ReplyOriginally posted by: Jayant Umrani
Thanks
Your work is very nice. Thanks for the code. I want to know one thing, is it possible to send and recieve
attachments(files) also. or we have to go for MAPI, I am very much new to socket programming. so pl. help me
Originally posted by: Bad lu
Email sender is ok, but Email receiver can not work.
8-(
Reply