SendSmtpTextMessage: Difference between revisions

From Opale Wiki
Jump to navigation Jump to search
(Created page with " This command sends a specified Email message to SMTP server on the specified GSM port. It requires an active data session on the specified GSM por. Message is sent with the content from the specified file that should contain formatted SMTP data including headers (see <nowiki>RFC 2822</nowiki>). If any of required parameters is not needed it can be specified as NULL string (""). Sender Email address will be used in "MAIL From" SMTP message, Recipient Email Addres...")
Tag: 2017 source edit
 
No edit summary
 
Line 2: Line 2:
This command sends a specified Email message to SMTP server on the specified GSM port. It requires an active data session on the specified GSM por.  
This command sends a specified Email message to SMTP server on the specified GSM port. It requires an active data session on the specified GSM por.  


Message is sent with the content from the specified file that should contain formatted SMTP data including headers (see <nowiki>RFC 2822</nowiki>).   
Message is sent with specified text in PLAIN-TEXT format.   


If any of required parameters is not needed it can be specified as NULL string ("").   
If any of required parameters is not needed it can be specified as NULL string ("").   
Line 18: Line 18:
!Returns
!Returns
|-
|-
|'''SendSmtpFileMessage'''
|'''SendSmtpTextMessage'''
|PortIndex, SMTPServerIPAddressorHostName, [:Peer Port], SenderName, SenderEmailAddress, RecepientEmailAddress, CCEmailAddress, BCCEmailAddress, Subject, MessageFilePath, [UserName, Password and SSLflag]  
|PortIndex, SMTPServerIPAddressorHostName, [:Peer Port], SenderName, SenderEmailAddress, RecepientEmailAddress, CCEmailAddress, BCCEmailAddress, Subject, MessageText, [UserName, Password and SSLflag]  
|[[R2D2 Error Codes|Error Code]] in case of error.
|[[R2D2 Error Codes|Error Code]] in case of error.
|}
|}
Line 28: Line 28:


'''EXAMPLE''' <syntaxhighlight lang="text">
'''EXAMPLE''' <syntaxhighlight lang="text">
~# SendSmtpFileMessage 0 "smtp.ultiroam.com" "name@ultiroam.com" "dest@gmail.com" "/var/tmp/test.eml"
~# SendSmtpTextMessage 0 smtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
EMAIL MESSAGE SENT
EMAIL MESSAGE SENT


~# SendSmtpFileMessage 0 "89182:25" "name@ultiroam.com" "dest@gmail.com" "/var/tmp/test.msg" "user1" "password" 60
~# SendSmtpTextMessage 0 89182:25 "from@acme.com" "Acme Team" "user@gmail.com", user1@yahoo.fr" "user2@hotmail.com" "top@ms.com" "Test" "Test message" "userauth" "passauth"
FILE NOT FOUND
DESTINATION HOST NOT REACHABLE
 
~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
AUTHENTICATION
 
~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
SMTP RECIPIENT REJECTED BY SERVER
 
~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" "userauth" "passauth"
PASSWORD REJECTED BY SERVER
 
~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" "userauth" "passauth"
USER NAME REJECTED BY SERVER
 
~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" 60
TIMEOUT EXPIRED
</syntaxhighlight>
</syntaxhighlight>
[[Category:R2D2]]
[[Category:R2D2]]
[[Category:DATA]]
[[Category:DATA]]

Latest revision as of 20:18, 1 April 2025

This command sends a specified Email message to SMTP server on the specified GSM port. It requires an active data session on the specified GSM por.

Message is sent with specified text in PLAIN-TEXT format.

If any of required parameters is not needed it can be specified as NULL string ("").

Sender Email address will be used in "MAIL From" SMTP message, Recipient Email Address will be used in "RCPT To".

Optional User Name and Password can be specified if authentication is required. Optional SSL flag can be added at the end of this command.

Command waits until Email message is sent or general timeout expired.

COMMAND

Command Line Arguments Returns
SendSmtpTextMessage PortIndex, SMTPServerIPAddressorHostName, [:Peer Port], SenderName, SenderEmailAddress, RecepientEmailAddress, CCEmailAddress, BCCEmailAddress, Subject, MessageText, [UserName, Password and SSLflag] Error Code in case of error.

OUTPUT

Success or Error Message (See Data Commands Messages)

EXAMPLE

~# SendSmtpTextMessage 0 smtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
EMAIL MESSAGE SENT

~# SendSmtpTextMessage 0 89182:25 "from@acme.com" "Acme Team" "user@gmail.com", user1@yahoo.fr" "user2@hotmail.com" "top@ms.com" "Test" "Test message" "userauth" "passauth"
DESTINATION HOST NOT REACHABLE

~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
AUTHENTICATION

~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message"
SMTP RECIPIENT REJECTED BY SERVER

~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" "userauth" "passauth"
PASSWORD REJECTED BY SERVER

~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" "userauth" "passauth"
USER NAME REJECTED BY SERVER

~# SendSmtpTextMessage 0 mtp.acme.com "from@acme.com" "Acme Team" "user@gmail.com" "" "" "Test" "Test message" 60
TIMEOUT EXPIRED