I assume the error occurs here in the code.
Are the values for ‘From’, ‘Sender’ and ‘ConfirmReadingTo’ all a valid email-address or empty?