Skip to content

Commit

Permalink
Allow file attachments with custom names (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
attila-tokes committed Jan 15, 2025
1 parent 3268ae3 commit e19c14c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/mimeattachment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@

/* [1] Constructors and Destructors */

MimeAttachment::MimeAttachment(QFile *file)
MimeAttachment::MimeAttachment(QFile *file, const QString& filename)
: MimeFile(file)
{
if (!filename.isEmpty()) {
this->setContentName(filename);
}

this->headerLines += "Content-disposition: attachment; filename=\"" + cName + "\"\r\n";
}

Expand Down
2 changes: 1 addition & 1 deletion src/mimeattachment.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SMTP_MIME_EXPORT MimeAttachment : public MimeFile

/* [1] Constructors and Destructors */

MimeAttachment(QFile* file);
MimeAttachment(QFile* file, const QString& filename = "");
~MimeAttachment();

/* [1] --- */
Expand Down
1 change: 0 additions & 1 deletion src/mimepart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <QBuffer>
#include "mimepart.h"
#include "quotedprintable.h"
#include "mimebase64formatter.h"
#include "mimeqpformatter.h"
#include "mimebase64encoder.h"
Expand Down

0 comments on commit e19c14c

Please sign in to comment.