SmtpMailInterface Class Reference IO

#include <network_smtpmail.h>

详细描述

Send mail via smtp.

公共成员函数

MAXON_METHOD Result < void >  AttachText (const String &text)
MAXON_METHOD Result < void >  AttachBin (const Url &fname, MEDIA media= MEDIA::UNKNOWN , MEDIASUB sub= MEDIASUB::UNKNOWN )
MAXON_METHOD Result < void >  AttachBin (const String &fileName, const Block < const Char > &data, MEDIA media= MEDIA::UNKNOWN , MEDIASUB sub= MEDIASUB::UNKNOWN )
MAXON_METHOD Result < void >  SetSender (const String &sender, const String &senderClearName)
MAXON_METHOD Result < void >  GetSender ( String &sender, String &senderClearName) const
MAXON_METHOD Result < void >  SetReceiver (const Block < const SmtpReceiver > &receiver)
MAXON_METHOD Result < void >  GetReceiver ( WritableArrayInterface < SmtpReceiver > &receiver) const
MAXON_METHOD Result < void >  SetSubject (const String &subject)
MAXON_METHOD Result < void >  GetSubject ( String &subject) const
MAXON_METHOD Result < void >  SetUserPassword (const String &user, const String &passwd)
MAXON_METHOD Result < void >  GetUserPassword ( String &user, String &passwd) const
MAXON_METHOD Result < void >  SendMimeMail (const String &hostName, Int port)

静态公共成员函数

static MAXON_METHOD SmtpMailInterface Alloc ( MAXON_SOURCE_LOCATION_DECLARATION )

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( SmtpMailInterface , MAXON_REFERENCE_NORMAL , "net.maxon.interface.smtpmail")

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( SmtpMailInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.interface.smtpmail"   
)
private

◆  Alloc()

static MAXON_METHOD SmtpMailInterface * Alloc ( MAXON_SOURCE_LOCATION_DECLARATION   )
static

function to allocate new instances of this object. use SmtpMailRef mail(MAXON_SOURCE_LOCATION); to allocate new object. SmtpMailRef is freed automatically.

◆  AttachText()

MAXON_METHOD Result <void> AttachText ( const String text )

Set the text body of the mail.

参数
[in] text The text of the mail body.
返回
IsOk() if the function succeded. HasError() if failed.

◆  AttachBin() [1/2]

MAXON_METHOD Result <void> AttachBin ( const Url fname ,
MEDIA   media = MEDIA::UNKNOWN ,
MEDIASUB   sub = MEDIASUB::UNKNOWN  
)

Attach an binary file.

参数
[in] fname The Url of the attachment. Set the right mode so that the mail gets the right type.
[in] media See MEDIA.
[in] sub See MEDIASUB.
返回
IsOk() if the function succeded. HasError() if failed.

◆  AttachBin() [2/2]

MAXON_METHOD Result <void> AttachBin ( const String fileName ,
const Block < const Char > &  data ,
MEDIA   media = MEDIA::UNKNOWN ,
MEDIASUB   sub = MEDIASUB::UNKNOWN  
)

Attach an binary file.

参数
[in] fileName File name of the attachment.
[in] data Binary data to attach.
[in] media See MEDIA.
[in] sub See MEDIASUB.
返回
IsOk() if the function succeded. HasError() if failed.

◆  SetSender()

MAXON_METHOD Result <void> SetSender ( const String sender ,
const String senderClearName  
)

Set the sender email address and name.

参数
[in] sender Email address of the sender.
[in] senderClearName Real name of the sender.
返回
IsOk() if the function succeded. HasError() if failed.

◆  GetSender()

MAXON_METHOD Result <void> GetSender ( String sender ,
String senderClearName  
) const

Get the sender email address and name.

参数
[out] sender Retrieves the email address of the sender.
[out] senderClearName Retrieves the real name of the sender.
返回
IsOk() if the function succeded. HasError() if failed.

◆  SetReceiver()

MAXON_METHOD Result <void> SetReceiver ( const Block < const SmtpReceiver > &  receiver )

Set the receiver email address and name.

参数
[in] receiver Email addresses of the receivers.
返回
IsOk() if the function succeded. HasError() if failed.

◆  GetReceiver()

MAXON_METHOD Result <void> GetReceiver ( WritableArrayInterface < SmtpReceiver > &  receiver ) const

Get the receiver email address and name.

参数
[out] receiver Retrieves the email address of the receiver.
返回
IsOk() if the function succeded. HasError() if failed.

◆  SetSubject()

MAXON_METHOD Result <void> SetSubject ( const String subject )

Set the subject of the mail.

参数
[in] subject Mail subject.
返回
IsOk() if the function succeded. HasError() if failed.

◆  GetSubject()

MAXON_METHOD Result <void> GetSubject ( String subject ) const

Get the subject of the mail.

参数
[out] subject Retrieves the email subject.
返回
IsOk() if the function succeded. HasError() if failed.

◆  SetUserPassword()

MAXON_METHOD Result <void> SetUserPassword ( const String user ,
const String passwd  
)

Sets the login user name and password for the smtp server.

参数
[in] user Username to logon at the smtp server.
[in] passwd Password to logon at the smtp server.
返回
IsOk() if the function succeded. HasError() if failed.

◆  GetUserPassword()

MAXON_METHOD Result <void> GetUserPassword ( String user ,
String passwd  
) const

Gets the login user name and password for the smtp server.

参数
[out] user Retrieves username to logon at the smtp server.
[out] passwd Retrieves to logon at the smtp server.
返回
IsOk() if the function succeded. HasError() if failed.

◆  SendMimeMail()

MAXON_METHOD Result <void> SendMimeMail ( const String hostName ,
Int   port  
)

Start the process of sending the mail.

参数
[in] hostName Smtp server address or name.
[in] port Smtp server port.
返回
IsOk() if the function succeded. HasError() if failed.