Difference between revisions of "OPENMAIL()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to connect to the specified mail server
 
Function to connect to the specified mail server
 
  
 
==Syntax==
 
==Syntax==
OPENMAIL(<expC1> [, <expC2>, <expC3> , <expC4>])
+
OPENMAIL(<expC1> [, <expC2>, <expC3>, <expC4> [, <expN1>]])
 
+
  
 
==See Also==
 
==See Also==
[[CLOSEMAIL()]], [[COUNTMAIL()]], [[DELETEMAIL()]], [[MAILATTACH()]], [[MAILCLOSE()]], [[MAILCOUNT()]], [[MAILDELETE()]], [[MAILERROR()]], [[MAILHEADER()]], [[MAILNODENAME()]], [[MAILOPEN()]], [[MAILREAD()]], [[MAILSAVEAS()]], [[MAILSEND()]], [[MAILUSERNAME()]], [[READMAIL()]], [[SENDMAIL()]]
+
[[BASE64_ENCODE()]], [[CLOSEMAIL()]], [[COUNTMAIL()]], [[DELETEMAIL()]], [[MAILATTACH()]], [[MAILCLOSE()]], [[MAILCOUNT()]], [[MAILDELETE()]], [[MAILERROR()]], [[MAILHEADER()]], [[MAILNODENAME()]], [[MAILOPEN()]], [[MAILREAD()]], [[MAILSAVEAS()]], [[MAILSEND()]], [[MAILUSERNAME()]], [[READMAIL()]], [[SENDMAIL()]]
 
+
  
 
==Description==
 
==Description==
The OPENMAIL() function is used to connect to the specified mail server.  The mail type POP3 should be used for reading mail, and SMTP used for sending mail.
+
The OPENMAIL() function is used to connect to the specified mail server.  The mail type POP3 should be used for reading mail, and SMTP/ESMTP used for sending mail.
 
+
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
!Parameters||Required||Default||Description
+
!width="15%"|Parameters||width="15%"| Required||width="15%"| Default||Description
 
|-
 
|-
|<expC1>||Yes||None||The node name or IP address of the mail server
+
|valign="top"|<expC1>||valign="top"|Yes||valign="top"|None||The node name or IP address of the mail server
 
|-
 
|-
|<expC2>||Yes||None||The user name with which to connect to the mail server
+
|valign="top"|<expC2>||valign="top"|Yes||valign="top"|None||The user name with which to connect to the mail server.  For ESMTP, this must be [[BASE64_ENCODE()|Base64 encoded]].
 
|-
 
|-
|<expC3>||Yes||None||The password for the user name
+
|valign="top"|<expC3>||Yes||None||The password for the user name.  For ESMTP, this must be [[BASE64_ENCODE()|Base64 encoded]].
 
|-
 
|-
|<expC4>||No||SMTP||The mail protocol type.  POP3 and SMTP are the currently supported protocols.
+
|valign="top"|<expC4>||valign="top"|No||valign="top"|SMTP||The mail protocol type.  POP3, SMTP and ESMTP are the currently supported protocols.  Support for ESMTP was introduced in Lianja v1.3.
 +
|-
 +
|valign="top"|<expN1>||valign="top"|No||valign="top"|25||The SMTP/ESMTP port number.
 
|-
 
|-
 
|}
 
|}
 
  
 
If successful the OPENMAIL() function will return .T., otherwise .F..  The MAILERROR() function can be used to return the error message if the MAILOPEN() fails.
 
If successful the OPENMAIL() function will return .T., otherwise .F..  The MAILERROR() function can be used to return the error message if the MAILOPEN() fails.
 
  
 
==Example==
 
==Example==
Line 49: Line 45:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Mail]]
 
 
[[Category:Mail Functions]]
 
[[Category:Mail Functions]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Function Extensions]]

Latest revision as of 08:37, 2 February 2015

Purpose

Function to connect to the specified mail server

Syntax

OPENMAIL(<expC1> [, <expC2>, <expC3>, <expC4> [, <expN1>]])

See Also

BASE64_ENCODE(), CLOSEMAIL(), COUNTMAIL(), DELETEMAIL(), MAILATTACH(), MAILCLOSE(), MAILCOUNT(), MAILDELETE(), MAILERROR(), MAILHEADER(), MAILNODENAME(), MAILOPEN(), MAILREAD(), MAILSAVEAS(), MAILSEND(), MAILUSERNAME(), READMAIL(), SENDMAIL()

Description

The OPENMAIL() function is used to connect to the specified mail server. The mail type POP3 should be used for reading mail, and SMTP/ESMTP used for sending mail.

Parameters Required Default Description
<expC1> Yes None The node name or IP address of the mail server
<expC2> Yes None The user name with which to connect to the mail server. For ESMTP, this must be Base64 encoded.
<expC3> Yes None The password for the user name. For ESMTP, this must be Base64 encoded.
<expC4> No SMTP The mail protocol type. POP3, SMTP and ESMTP are the currently supported protocols. Support for ESMTP was introduced in Lianja v1.3.
<expN1> No 25 The SMTP/ESMTP port number.

If successful the OPENMAIL() function will return .T., otherwise .F.. The MAILERROR() function can be used to return the error message if the MAILOPEN() fails.

Example

// Open POP3 for reading mail
m_open = openmail("mailserver.company.com", "username", "password", "POP3")
if not m_open
    dialog box mailerror()
endif
closemail()
 
// Open SMTP for sending
m_open = mailopen("mailserver.company.com")
if not m_open
    dialog box mailerror()
endif
closemail()