CreateMail()
语法
Result = CreateMail(#Mail, From$, Subject$ [, Encoding])概要
Create a new, empty mail.
参数
A number to identify the new mail. #PB_Any can be used to auto-generate this number. From$ The sender address for the mail. Subject$ The subject line for the mail. Encoding (optional) The encoding for the mail. It can be one of the following values: #PB_Ascii : The mail body will be in ascii (default) #PB_UTF8 : The mail body will be in UTF-8
返回值
Returns nonzero if the mail was created successfully and zero if not. If #PB_Any was used as the #Mail parameter, then the auto-generated number is returned in case of success.
Remarks
SetMailBody(), SetMailAttribute(), AddMailAttachment() and AddMailAttachmentData() can be used to change the content of the #Mail.
Note: According to the RFC 2822 standard a line break in an e-mail need to be done always using the CRLF chars.
示例
InitNetwork() If CreateMail(0, "test@purebasic.com", "Hello") SetMailBody(0, "This is a body !" + #CRLF$ + "Second line") Debug "Mail created" Else Debug "Can't create the mail" EndIf
参阅
InitNetwork(), SetMailBody(), SetMailAttribute(), AddMailAttachment(), AddMailAttachmentData(), SendMail(), FreeMail()
已支持操作系统
所有