Bug #1385
closedMail Example is not running
0%
Description
Hello!
The mail Example in the doxgen doc is not running. http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1Mail_1_1Client.html
./src/SmtpClient.cpp:55:19: error: aggregate 'Wt::Mail::Message message' has incomplete type and cannot be defined
./src/SmtpClient.cpp:56:21: error: 'Mailbox' is not a member of 'Wt::Mail'
./src/SmtpClient.cpp:57:26: error: 'To' is not a member of 'Wt::Mail'
./src/SmtpClient.cpp:57:36: error: 'Mailbox' is not a member of 'Wt::Mail'
./src/SmtpClient.cpp:59:61: error: expected ';' before ')' token
./src/SmtpClient.cpp:61:15: error: expected ')' before 'http'
./src/SmtpClient.cpp:62:44: error: expected ';' before ')' token
The code and my comments:
./src/SmtpClient.cpp:55: Mail::Message message;
// one ")" too much?
./src/SmtpClient.cpp:56: message.setFrom(Mail::Mailbox("kudos@corp.org", "Kudos Dukos"));
// one ")" too much?
./src/SmtpClient.cpp:57: message.addRecipient(Mail::To, Mail::Mailbox("koen@emweb.be", "Koen Deforche"));
./src/SmtpClient.cpp:58: message.setSubject("Hey there, koen!");
// one ")" too much?
./src/SmtpClient.cpp:59: message.setBody("That mail client seems to be working."));
./src/SmtpClient.cpp:60: message.addHtmlBody(\"
\"
// missing a "\" before \"
./src/SmtpClient.cpp:61: "That mail client"
// one ")" too much?
./src/SmtpClient.cpp:62: \" seems to be working just great!
"));
./src/SmtpClient.cpp:63: Mail::Client client;
./src/SmtpClient.cpp:64: client.connect("localhost\");
./src/SmtpClient.cpp:65: client.send(message);
With my code modifications i get:
./src/SmtpClient.cpp:55:19: error: aggregate 'Wt::Mail::Message message' has incomplete type and cannot be defined
./src/SmtpClient.cpp:56:21: error: 'Mailbox' is not a member of 'Wt::Mail'
./src/SmtpClient.cpp:57:26: error: 'To' is not a member of 'Wt::Mail'
./src/SmtpClient.cpp:57:36: error: 'Mailbox' is not a member of 'Wt::Mail'
...I have no more ideas.
rpm -qa wt-devel :
wt-devel-3.2.1-1.fc17.R.x86_64
Kind regards
Olaf Radicke
(briefkasten@olaf-radicke.de)
Updated by Koen Deforche over 12 years ago
- Status changed from New to Resolved
- Target version set to 3.2.2-p1
On behalf of Olaf Radicke:
Hi!
I have open the Ticket 1385 and now i know the answer. But i can't writ on the
Ticket. So i post the fix on this mailing list. I hope it's okay...
--- a/src/Wt/Mail/Client
+++ b/src/Wt/Mail/Client
@@ -28,18 +28,21 @@ class Message;
* The SMTP client can send one or more mail messages to an SMTP host.
*
* \code
+ * #include <Wt/Mail/Client>
+ * #include <Wt/Mail/Message>
+ *
* Mail::Message message;
- * message.setFrom(Mail::Mailbox("kudos@corp.org", "Kudos Dukos"));
- * message.addRecipient(Mail::To, Mail::Mailbox("koen@emweb.be", "Koen
Deforche"));
- * message.setSubject("Hey there, koen!");
- * message.setBody("That mail client seems to be working."));
- * message.addHtmlBody("<p>"
- * "<a href="http://www.webtoolkit.eu/wt">That mail client</a>"
- * " seems to be working just great!</p>"));
+ * message.setFrom ( Mail::Mailbox("kudos@corp.org", "Kudos Dukos" );
+ * message.addRecipient ( Mail::To, Mail::Mailbox("koen@emweb.be", "Koen
Deforche" );
+ * message.setSubject ( "Hey there, koen!" );
+ * message.setBody ( "That mail client seems to be working." );
+ * message.addHtmlBody ( "<p>"
+ * "<a href=\"http://www.webtoolkit.eu/wt\">That mail client</a>"
+ * " seems to be working just great!</p>" );
*
* Mail::Client client;
- * client.connect("localhost");
- * client.send(message);
+ * client.connect ( "localhost" );
+ * client.send ( message );
* \endcode
*
* Only the bare essentials of the SMTP protocol are current implemented,
best wishes
Olaf Radicke
(germany / munich)
Updated by Koen Deforche about 12 years ago
- Status changed from Resolved to Closed
- Target version changed from 3.2.2-p1 to 3.2.3
Fixed in Wt 3.2.3 RC1.