Sergey Pastor / 1

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

smtp_client.h File Reference

smtp_client.h File Reference

SMTP client (Simple Mail Transfer Protocol) More...

Go to the source code of this file.

Data Structures

struct  SmtpAuthInfo
 Authentication information. More...
struct  SmtpMailAddr
 Mail address. More...
struct  SmtpMail
 Mail contents. More...
struct  SmtpClientContext
 SMTP client context. More...

Enumerations

enum  SmtpRecipientType
 

Recipient type.

More...

Functions

error_t smtpSendMail (const SmtpAuthInfo *authInfo, const SmtpMail *mail)
 Send a mail to the specified recipients.
error_t smtpEhloReplyCallback (SmtpClientContext *context, char_t *replyLine, uint_t replyCode)
 Callback function to parse EHLO response.
error_t smtpSendAuthLogin (SmtpClientContext *context, const SmtpAuthInfo *authInfo)
 Authentication using LOGIN mechanism.
error_t smtpSendAuthPlain (SmtpClientContext *context, const SmtpAuthInfo *authInfo)
 Authentication using PLAIN mechanism.
error_t smtpSendAuthCramMd5 (SmtpClientContext *context, const SmtpAuthInfo *authInfo)
 Authentication using CRAM-MD5 mechanism.
error_t smtpSendData (SmtpClientContext *context, const SmtpMail *mail)
 Send message body.
error_t smtpSendCommand (SmtpClientContext *context, const char_t *command, uint_t *replyCode, SmtpReplyCallback callback)
 Send SMTP command and wait for a reply.
error_t smtpWrite (SmtpClientContext *context, const void *data, size_t length, uint_t flags)
 Send data to the SMTP server.
error_t smtpRead (SmtpClientContext *context, void *data, size_t size, size_t *received, uint_t flags)
 Receive data from the SMTP server.

Detailed Description

SMTP client (Simple Mail Transfer Protocol)

License

Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author:
Oryx Embedded SARL (www.oryx-embedded.com)
Version:
1.7.6

Definition in file smtp_client.h.


Enumeration Type Documentation

Recipient type.

Definition at line 122 of file smtp_client.h.


Function Documentation

error_t smtpEhloReplyCallback ( SmtpClientContext context,
char_t *  replyLine,
uint_t  replyCode 
)

Callback function to parse EHLO response.

Parameters:
[in]contextSMTP client context
[in]replyLineResponse line
[in]replyCodeResponse code
Returns:
Error code

Definition at line 430 of file smtp_client.c.

error_t smtpRead ( SmtpClientContext context,
void *  data,
size_t  size,
size_t *  received,
uint_t  flags 
)

Receive data from the SMTP server.

Parameters:
[in]contextSMTP client context
[out]dataBuffer into which received data will be placed
[in]sizeMaximum number of bytes that can be received
[out]receivedActual number of bytes that have been received
[in]flagsSet of flags that influences the behavior of this function
Returns:
Error code

Definition at line 943 of file smtp_client.c.

error_t smtpSendAuthCramMd5 ( SmtpClientContext context,
const SmtpAuthInfo authInfo 
)

Authentication using CRAM-MD5 mechanism.

Parameters:
[in]contextSMTP client context
[in]authInfoAuthentication information
Returns:
Error code

Definition at line 603 of file smtp_client.c.

error_t smtpSendAuthLogin ( SmtpClientContext context,
const SmtpAuthInfo authInfo 
)

Authentication using LOGIN mechanism.

Parameters:
[in]contextSMTP client context
[in]authInfoAuthentication information
Returns:
Error code

Definition at line 493 of file smtp_client.c.

error_t smtpSendAuthPlain ( SmtpClientContext context,
const SmtpAuthInfo authInfo 
)

Authentication using PLAIN mechanism.

Parameters:
[in]contextSMTP client context
[in]authInfoAuthentication information
Returns:
Error code

Definition at line 555 of file smtp_client.c.

error_t smtpSendCommand ( SmtpClientContext context,
const char_t *  command,
uint_t *  replyCode,
SmtpReplyCallback  callback 
)

Send SMTP command and wait for a reply.

Parameters:
[in]contextSMTP client context
[in]commandCommand line
[out]replyCodeSMTP server reply code
[in]callbackOptional callback to parse each line of the reply
Returns:
Error code

Definition at line 835 of file smtp_client.c.

error_t smtpSendData ( SmtpClientContext context,
const SmtpMail mail 
)

Send message body.

Parameters:
[in]contextSMTP client context
[in]mailMail contents
Returns:
Error code

Definition at line 696 of file smtp_client.c.

error_t smtpSendMail ( const SmtpAuthInfo authInfo,
const SmtpMail mail 
)

Send a mail to the specified recipients.

Parameters:
[in]authInfoAuthentication information
[in]mailMail contents
Returns:
Error code

Definition at line 61 of file smtp_client.c.

error_t smtpWrite ( SmtpClientContext context,
const void *  data,
size_t  length,
uint_t  flags 
)

Send data to the SMTP server.

Parameters:
[in]contextSMTP client context
[in]dataPointer to a buffer containing the data to be transmitted
[in]lengthNumber of bytes to be transmitted
[in]flagsSet of flags that influences the behavior of this function

Definition at line 915 of file smtp_client.c.