PowerProtect smtp_send.py generates error: 'NoneType' object has no attribute 'encode'

Summary: The PowerProtect Data Manager is used to protect the environment and "Support > Email Setup" is being configured to receive email notifications.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

The Email Setup test email fails indicating to validate the Simple Mail Transfer Protocol (SMTP) details.

Error
104: Sending the test email failed. Socket error : mailserver.mydomain.com
Verify the SMTP details and try again. 

PowerProtect Data Manager contains the /usr/local/brs/bin/smtp_send.py script to help troubleshoot SMTP-related issues. The script fails to run and generates the following information:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -HOST mailserver.mydomain.com -FROM test_email_address@dell.com -PORT 25 -ARGS True -S "PowerProtect Data Manager test email" -C plain -R test_email_address@dell.com
Traceback (most recent call last):
  File "/usr/local/brs/bin/smtp_send.py", line 338, in <module>
    main()
  File "/usr/local/brs/bin/smtp_send.py", line 308, in main
    outer.attach(MIMEText(args.body, args.content_type))
  File "/usr/lib64/python3.4/email/mime/text.py", line 33, in {}init{}
    _text.encode('us-ascii')
AttributeError: 'NoneType' object has no attribute 'encode' 

Cause

The smtp_send.py help shows that all commands are optional, but most of them are required:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -h

usage: smtp_send.py [-h] [-HOST MAILSERVER] [-PORT PORT] [-USER USERNAME]
                    [-PASS PASSWORD] [-FROM MAILFROM] [-ARGS USEARGS]
                    [-R RECIPIENTS [RECIPIENTS ...]] [-S SUBJECT]
                    [-C CONTENT_TYPE]
                    [-T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}]
                    [-p TIMEOUT] [--hide] [-F FILENAME | -B BODY]
optional arguments:
  -h, --help            show this help message and exit
  -HOST MAILSERVER      Mail server
  -PORT PORT            Mail port
  -USER USERNAME        Mail username
  -PASS PASSWORD        Mail password
  -FROM MAILFROM        Mail from
  -ARGS USEARGS         Use args
  -R RECIPIENTS [RECIPIENTS ...]
                        Mail recipients
  -S SUBJECT            Mail subject
  -C CONTENT_TYPE       Content Type
  -T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}
                        Message type
  -p TIMEOUT            Timeout in minutes
  --hide                hide to field from recipients
  -F FILENAME, --Files FILENAME
                        File to be attached
  -B BODY, --Body BODY  Message body

Resolution

All the options referenced must be used while using the smtp_send.py script instead of relying on the "help" command output. Example syntax and output:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -HOST mailserver.mydomain.com -FROM test_email_address@dell.com -PORT 25 -ARGS True -T MAIL_BODY_AS_ARGUMENT -S "PowerProtect Data Manager test email" -B "This is a test email from a PowerProtect Data Manager appliance" -C plain -R test_email_address@dell.com
2023-11-08 18:05:10.150515 INFO : Sending email with subject : PowerProtect Data Manager test email
2023-11-08 18:05:10.866943 INFO : sending mail
2023-11-08 18:05:11.071116 INFO : result: {}
admin@my-ppdm:~>

Additional Information

Required arguments:
  -HOST MAILSERVER      Mail server
  -FROM MAILFROM        Mail from
  -ARGS USEARGS         Use args
  -R RECIPIENTS [RECIPIENTS ...]
                        Mail recipients
  -S SUBJECT            Mail subject
  -C CONTENT_TYPE       Content Type
  -T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}
                        Message type
  -B BODY, --Body BODY  Message body
Optional arguments:
  -h, --help            show this help message and exit
  -PORT PORT            Mail port
  -USER USERNAME        Mail username
  -PASS PASSWORD        Mail password
  -p TIMEOUT            Timeout in minutes
  --hide                hide to field from recipients
  -F FILENAME, --Files FILENAME
                        File to be attached
Article Properties
Article Number: 000219362
Article Type: Solution
Last Modified: 03 Dec 2025
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.