SMTPSEND command fails when sending email messages with apostrophes in email addresses - Support

SMTPSEND command fails when sending email messages with apostrophes in email addresses

From Support

Jump to: navigation, search
If you have a question or seek clarification, please call Technical Support.

Problem:

SMTPSEND command is causing an error and program dump when sending an email message.

The following information was shown in the joblog:

16 records copied from member SMTPSTDOUT.                                
Error 00019 was returned from SMTP Email API.                            
Character 's' not valid following string ERRORMAIL'.                   
Character  not valid following string 'again     '.                   
A matching apostrophe not found.                                         
A matching parenthesis not found.                                        
Error found on *N command.                                               
Errors occurred in command.                                              
Function check. CPF0006 unmonitored by SMTP011R at statement 0000000292, 
  instruction X'0000'.

Solution:

You maybe calling SMTPSEND in a CL program and using a 60 character variable for the From email address and the To email address.

Look at the program dumps, if it looks like there is additional garbage text in the To email address with single quotes, this is causing the error.

However the single quoted data could be additional text that should not have been in the email address.

This is usually caused if a parameter is not padded to its entire length when passing to a CL program.

Example: If 30 bytes is passed to a CL program expecting 60 bytes for the email address, OS/400 will potentially pass garbage to the last 30 bytes of the parameter and cause data corruption to occur, thus causing SMTPSEND to fail.

If you pass 60 bytes of data to your 60 byte field in the CL program, the problem should be resolved.

Personal tools