X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/decb3a6a16ea5acf1dfcdb1b70cb6edaa09840c0..14dd645ee16eb022afb19f35d0c8cfdf2d3cdee9:/contrib/src/net/smapi.cpp diff --git a/contrib/src/net/smapi.cpp b/contrib/src/net/smapi.cpp index 4412ad15a2..81617a39b8 100644 --- a/contrib/src/net/smapi.cpp +++ b/contrib/src/net/smapi.cpp @@ -286,6 +286,17 @@ bool wxMapiSession::Send(wxMailMessage& message) //Allocate the recipients array mapiMessage.lpRecips = new MapiRecipDesc[mapiMessage.nRecipCount]; + + // If we have a 'From' field, use it + if (!message.m_from.IsEmpty()) + { + mapiMessage.lpOriginator = new MapiRecipDesc; + ZeroMemory(mapiMessage.lpOriginator, sizeof(MapiRecipDesc)); + + mapiMessage.lpOriginator->ulRecipClass = MAPI_ORIG; + // TODO Do we have to call Resolve? + mapiMessage.lpOriginator->lpszName = (LPSTR) message.m_from.c_str(); + } //Setup the "To" recipients int nRecipIndex = 0; @@ -413,8 +424,9 @@ bool wxMapiSession::Send(wxMailMessage& message) if (nAttachmentSize) delete [] mapiMessage.lpFiles; - //Free up the Recipients memory + //Free up the Recipients and Originator memory delete [] mapiMessage.lpRecips; + delete mapiMessage.lpOriginator; return bSuccess; }