# eric6.UI.EmailDialog

Module implementing a dialog to send bug reports.

### Global Attributes

None

### Classes

EmailDialog | Class implementing a dialog to send bug reports.

### Functions

_encode_base64 | Function to encode the message's payload in Base64.

## EmailDialog

Class implementing a dialog to send bug reports.

### Derived from

QDialog, Ui_EmailDialog

### Class Attributes

None

### Class Methods

None

### Methods

EmailDialog | Constructor
__createMultipartMail | Private method to create a multipart mail message.
__createSimpleMail | Private method to create a simple mail message.
__encodedHeader | Private method to create a correctly encoded mail header.
__encodedText | Private method to create a MIMEText message with correct encoding.
__sendmail | Private method to actually send the message.
attachFile | Public method to add an attachment.
keyPressEvent | Protected method to handle the user pressing the escape key.
on_addButton_clicked | Private slot to handle the Add...
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_buttonBox_rejected | Private slot to handle the rejected signal of the button box.
on_deleteButton_clicked | Private slot to handle the Delete button.
on_message_textChanged | Private slot to handle the textChanged signal of the message edit.
on_sendButton_clicked | Private slot to send the email message.
on_subject_textChanged | Private slot to handle the textChanged signal of the subject edit.

### Static Methods

None

#### EmailDialog (Constructor)

EmailDialog(mode="bug", parent=None)

Constructor

mode
  mode of this dialog (string, "bug" or "feature")
parent
  parent widget of this dialog (QWidget)

#### EmailDialog.__createMultipartMail

__createMultipartMail()

Private method to create a multipart mail message.

Returns:
  string containing the mail message

#### EmailDialog.__createSimpleMail

__createSimpleMail()

Private method to create a simple mail message.

Returns:
  string containing the mail message

#### EmailDialog.__encodedHeader

__encodedHeader(txt)

Private method to create a correctly encoded mail header.

txt
  header text to encode (string)

Returns:
  encoded header (email.header.Header)

#### EmailDialog.__encodedText

__encodedText(txt)

Private method to create a MIMEText message with correct encoding.

txt
  text to be put into the MIMEText object (string)

Returns:
  MIMEText object

#### EmailDialog.__sendmail

__sendmail(msg)

Private method to actually send the message.

msg
  the message to be sent (string)

Returns:
  flag indicating success (boolean)

#### EmailDialog.attachFile

attachFile(fname, deleteFile)

Public method to add an attachment.

fname
  name of the file to be attached (string)
deleteFile
  flag indicating to delete the file after it has been sent (boolean)

#### EmailDialog.keyPressEvent

keyPressEvent(ev)

Protected method to handle the user pressing the escape key.

ev
  key event (QKeyEvent)

#### EmailDialog.on_addButton_clicked

on_addButton_clicked()

Private slot to handle the Add... button.

#### EmailDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
  button that was clicked (QAbstractButton)

#### EmailDialog.on_buttonBox_rejected

on_buttonBox_rejected()

Private slot to handle the rejected signal of the button box.

#### EmailDialog.on_deleteButton_clicked

on_deleteButton_clicked()

Private slot to handle the Delete button.

#### EmailDialog.on_message_textChanged

on_message_textChanged()

Private slot to handle the textChanged signal of the message edit.

#### EmailDialog.on_sendButton_clicked

on_sendButton_clicked()

Private slot to send the email message.

#### EmailDialog.on_subject_textChanged

on_subject_textChanged(txt)

Private slot to handle the textChanged signal of the subject edit.

txt
  changed text (string)

Up

## _encode_base64

_encode_base64(msg)

Function to encode the message's payload in Base64.

Note: It adds an appropriate Content-Transfer-Encoding header.

msg
  reference to the message object (email.Message)

Up