Demo 3 modified.
The demo files was removed from QT Creator project file (SMTPEmail.pro)
This commit is contained in:
parent
a118309811
commit
2d745b6662
@ -19,9 +19,7 @@ SOURCES += \
|
|||||||
src/mimemessage.cpp \
|
src/mimemessage.cpp \
|
||||||
src/mimepart.cpp \
|
src/mimepart.cpp \
|
||||||
src/mimetext.cpp \
|
src/mimetext.cpp \
|
||||||
src/smtpclient.cpp \
|
src/smtpclient.cpp
|
||||||
demos/demo2/sendemail.cpp \
|
|
||||||
demos/demo2/demo2.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
src/emailaddress.h \
|
src/emailaddress.h \
|
||||||
@ -33,13 +31,10 @@ HEADERS += \
|
|||||||
src/mimepart.h \
|
src/mimepart.h \
|
||||||
src/mimetext.h \
|
src/mimetext.h \
|
||||||
src/smtpclient.h \
|
src/smtpclient.h \
|
||||||
src/SmtpMime \
|
src/SmtpMime
|
||||||
demos/demo2/sendemail.h
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
demos/demo2/printscreen.png \
|
|
||||||
LICENSE \
|
LICENSE \
|
||||||
README.md
|
README.md
|
||||||
|
|
||||||
FORMS += \
|
FORMS +=
|
||||||
demos/demo2/sendemail.ui
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Copyright (c) 2011 - Tőkés Attila
|
||||||
|
|
||||||
|
This file is part of SmtpClient for Qt.
|
||||||
|
|
||||||
|
SmtpClient for Qt is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
SmtpClient for Qt is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY.
|
||||||
|
|
||||||
|
See the LICENSE file for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
#include <QtGui/QApplication>
|
#include <QtGui/QApplication>
|
||||||
#include "../src/SmtpMime"
|
#include "../src/SmtpMime"
|
||||||
|
|
||||||
@ -23,22 +39,16 @@ int main(int argc, char *argv[])
|
|||||||
// Add some text
|
// Add some text
|
||||||
|
|
||||||
MimeText text;
|
MimeText text;
|
||||||
|
text.setText("Hi!\n This is an email with some attachments.");
|
||||||
text.setText("Hi,\nThis is a simple email message with some attachments.\n");
|
|
||||||
|
|
||||||
message.addPart(&text);
|
message.addPart(&text);
|
||||||
|
|
||||||
|
|
||||||
// Now we create the attachment object
|
// Now we create the attachment object
|
||||||
|
|
||||||
MimeAttachment attachment (new QFile("image1.jpg"));
|
MimeAttachment attachment (new QFile("image1.jpg"));
|
||||||
|
|
||||||
// the file type can be setted. (by default is application/octet-stream)
|
// the file type can be setted. (by default is application/octet-stream)
|
||||||
|
|
||||||
attachment.setType("image/jpg");
|
attachment.setType("image/jpg");
|
||||||
|
|
||||||
// Now add it to message
|
// Now add it to message
|
||||||
|
|
||||||
message.addPart(&attachment);
|
message.addPart(&attachment);
|
||||||
|
|
||||||
// Add an another attachment
|
// Add an another attachment
|
||||||
|
Loading…
Reference in New Issue
Block a user