func X3.EN_SMTP_SEND_EMAIL(Char FROM_IN, Char() RECIPIENTS_IN, Char() COPIES_IN, Char() INVISIBLES_IN, Char SUBJECT_IN, Clbfile MESSAGE_IN, Char() ATTACHMENTS_IN, Char TYPE_IN, Tinyint ACKNOWLEDGE_IN, Char REPLY_TO_IN, Tinyint PRIORITY_IN, Char LOGIN_IN, Char PASS_IN, Char SMTP_SERVER_IN, Integer SMTP_PORT_IN, Char SMTP_SECURITY_IN, Char IMAP_SERVER_IN, Integer IMAP_PORT_IN, Char IMAP_SECURITY_IN, Char IMAP_DIRECTORY_IN) : Tinyint

Allows you to send an email through a server and a data connection.
Managing primary, copy and invisible recipients.
Ability to set any SMTP server
Message copied to sender's "Sent Emails".

  • FROM_IN Char Contains the email address of the sender
  • RECIPIENTS_IN Char() Array of recipient emails
  • COPIES_IN Char() Table of emails in copy (CC)
  • INVISIBLES_IN Char() Array of invisible emails (BCC)
  • SUBJECT_IN Char Email subject
  • MESSAGE_IN Clbfile Email body in text or html
  • ATTACHMENTS_IN Char() Array of attachments to attach (absolute paths to files to attach)
  • TYPE_IN Char Message type ("HTML" or "TXT")
  • ACKNOWLEDGE_IN Tinyint Request an acknowledgment (1 or 0)
  • REPLY_TO_IN Char Possible reply email address
  • PRIORITY_IN Tinyint Email priority (1=High, 3=Normal, 5=Low)
  • LOGIN_IN Char Contains the login for the SMTP connection (and possibly IMAP)
  • PASS_IN Char Contains the password for the SMTP connection (and IMAP if necessary)
  • SMTP_SERVER_IN Char Contains the address of the SMTP server
  • SMTP_PORT_IN Integer Contains the SMTP server port number (25, 465, 587, 2525, ...)
  • SMTP_SECURITY_IN Char Contains SMTP server security ("SSL", "TLS", "")
  • IMAP_SERVER_IN Char Contains the address of the IMAP server
  • IMAP_PORT_IN Integer Contains the port number of the IMAP server (153, 993, ...)
  • IMAP_SECURITY_IN Char Contains the IMAP server security ("SSL", "TLS", "")
  • IMAP_DIRECTORY_IN Char Contains the destination IMAP folder for sent emails (Ex: "Sent")
Return Tinyint 1 if OK and 0 otherwise
Example

Local Char RECIPIENTS(80)(5), COPIES(80)(5), INVISIBLES(80)(5), FILES(80)(5)
Local Clbfile MESSAGE(4)
RECIPIENTS(0) = "contact@lvexpertisex3.com"
FILES(0) = filpath('TRA',GTRACE,'tra')
MESSAGE = "Hello,<br>This message is a</b> test message in <b>HTML"
Infbox "Function return: " + num$(func X3.EN_SMTP_SEND_EMAIL("contact@lvexpertisex3.com",
& RECIPIENTS,
& COPIES,
& INVISIBLES,
& "Test message",
& MESSAGE,
& FILES,
& "HTML",
& 0,
& "",
& 1,
& "contact",
& "ThisIsMichelMyPassword",
& "smtp.lvexpertisex3.com",
& 465,
& "SSL",
& "imap.lvexpertisex3.com",
& 993,
& "SSL",
& "Sent"))