The EmailConnectSSL function connects to the email server using SSL over Stunnel.  Required for sending mail through gmail, yahoo mail and other mail providers.

 

Most often the only differences in settings between each mail provider are the server names and the SMTP ports.  The SSL port numbers are values that like 465, 587 and other port numbers.

 

Provider     Port  Server Name

--------     ----  -----------

  GMAIL     465   smtp.gmail.com

            995   pop.gmail.com

            993   imap.gmail.com

 

  HotMail   587   smtp.live.com

            995   pop3.live.com

 

  Yahoo     465   plus.smtp.mail.yahoo.com

            995   plus.pop.mail.yahoo.com

 

  MS Online 587   smtp.mail.microsoftonline.com

            995   pop.mail.microsoftonline.com

 

  Sympatico 587   smtphm.sympatico.ca

            995   pophm.sympatico.ca

 

Syntax:

connected = EmailConnectSSL( serverName, [returnEmail], [replyEmail], [userName], [password], [port] )

 

Parameter:

Description:

serverName

The name of the email server.

[returnEmail]

Optional: The return address.

[replyEmail]

Optional: The reply address.

[userName]

Optional: The user's "username-ID" for their email account.

[password]

Optional: The password for the email account.

[port]

Optional: The Out-Going SMTP connection port number.

 

Example:

'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'  Connect to user's Out-Going mail server
If EmailConnectSSL( "smtp.gmail.com", _
                  "tradingblox@gmail.com", _
                  "tradingblox@gmail.com", _
                  "tradingblox@gmail.com", _
                  "password", 465 ) THEN
  '  When Connection is reported as TRUE,...
  '  Send a HTML email message here:
  EmailSendHTML( "tim@tradingblox.com", _
                "TradingBlox Orders", "@" + test.orderReportPath )
  '  Send the same HTML email message here:
  EmailSendHTML( "tim@tradingblox.com", "Trading Blox Reports", _
                "<IMG SRC='cid:message-root.1'>", "", "", "", _
                "Images/TradingBloxLogo.jpg" )
  '  Send a regular Text-Only email message here:
  EmailSend( "tim@tradingblox.com", "Trading Blox Orders", _
            "Order Report Attached", "", "", test.orderReportPath )
ELSE
  '  Create an Error condition that generates a message
  ERROR ( "Unable to connect to email server" )
ENDIF
 
'  Disconnect from the user's out-going email server
EmailDisconnect()
'  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Returns:

connected = True, when a connection is successful, and a False when it fails.

 

Links:

 

See Also:

 

 


Edit Time: 9/25/2017 09:09:54 AM


Topic ID#: 275

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software