Click here to Skip to main content
15,896,201 members
Articles / Desktop Programming / MFC

SMTP Server

Rate me:
Please Sign up or sign in to vote.
4.43/5 (28 votes)
22 Sep 2007GPL34 min read 144.1K   5.3K   47  
This article shows how to design an SMTP server
// stdafx.cpp : source file that includes just the standard includes
// MailSocket.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"



// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
/*
int ReceiveLine(SOCKET soc, char *buf, int len)
{
	char lbuf[1025];
	int llen,
		count=0;

	while(llen=recv(soc,lbuf,sizeof(lbuf),0)>0)
	{
		if(strchr(lbuf,'\n')!=NULL)
		{
			buf[count]=0;
			return 0;
		}

		strncpy(&buf[count++],buf,len);
	}

	return WSAGetLastError();
}
*/

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer Microsoft
United States United States
Have completed BSc in Computer Science & Engineering from Shah Jalal University of Science & Technology, Sylhet, Bangladesh (SUST).

Story books (specially Masud Rana series), tourism, songs and programming is most favorite.

Blog:
Maruf Notes
http://blog.kuashaonline.com

Comments and Discussions