GetEmail

#include "email.h"

int GetEmail( M_DATA  *pMailData, char*  destFile )

Description

This function retrieves an E-mail from the specified address and saves it as a tiff image. The E-mail text is the first page of the tiff image. The following pages are the attached files, etc.

 

For example: If you have an E-mail, which contains a text message and a tiff image which has 10 pages then the result is a tiff image which has 11 pages. The first page is the message and the next 10 pages are the original tiff image.

Parameters

M_DATA

*pMailData

This structure contains the user name, the password and the server name needed to retrieve the new E-mail. (see M_DATA structure)

char*

destFile

The destination TIFF image file name. This file contains the message which arrived. If this file already exist the function appends the new message to the file. (The file path should exist!)

Return values

ERR_POP3_OK                  New message arrived.

ERR_POP3_BADUSER    No such User or bad password.

ERR_POP3_NOMAIL         No new message.

ERR_POP3_CANNOTCONNECT     Cannot connect to the POP3 server.

ERR_POP3_UNSPECIFIED               Unspecified error.

ERR_INVALID_PARAMETER            Invalid parameter value.

Code examples

M_DATA m_data;

strcpy( m_data.user, "username" );

strcpy( m_data.password, "postmaster" );

strcpy( m_data.server, "10.0.0.42" );

GetEmail(&m_data, "D:\\My Documents\\email.tif");