Unicode C++ Requires Chilkat v11.0.0+
Unicode C++
Create an inline forward
See more Email Object Examples
Create a forward from a saved email, set the forwarding author and destination, and inspect the generated subject and body. Save the draft before submitting it to SMTP. To introduce the original with a separate cover note, use the attached-message example.
Chilkat Unicode C++ Downloads
#include <CkEmailW.h>
void ChilkatSample(void)
{
bool success = false;
// Assumes Chilkat is unlocked. See Global Unlock Sample.
CkEmailW original;
success = original.LoadEml(L"alternatives.eml");
if (success != true) {
wprintf(L"%s\n",original.lastErrorText());
return;
}
CkEmailW forward;
success = original.ToForward(forward);
if (success != true) {
wprintf(L"%s\n",original.lastErrorText());
return;
}
forward.put_From(L"Workshop team <events@example.com>");
success = forward.AddTo(L"Coordinator",L"coordinator@example.net");
if (success != true) {
wprintf(L"%s\n",forward.lastErrorText());
return;
}
wprintf(L"%s\n",forward.subject());
if (forward.HasHtmlBody() == true) {
wprintf(L"%s\n",forward.getHtmlBody());
}
else {
wprintf(L"%s\n",forward.getPlainTextBody());
}
success = forward.SaveEml(L"forward.eml");
if (success != true) {
wprintf(L"%s\n",forward.lastErrorText());
return;
}
wprintf(L"Saved forward.eml.\n");
}