<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Email mit !C! Senden]]></title><description><![CDATA[<p>Hi all,<br />
ich würde gerne ein Programm schreiben, was mit ANSI C geschrieben ist, und eine Email sendet.</p>
<p>Ich habe erst ein Thread in <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-207832.html" rel="nofollow">ANSI C</a> aufgemacht aber hier hätte es wohl hingehört, naja ich kanns ja nich verschieben und meiner Bitte dies zu tun wurde auch keine Folge geleistet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Ja ich habe mir jetzt mal eine gmx Emailadresse zugelegt und würde gerne zu dieser Emailadresse eine Email senden, und da soll als absender z.B. <a href="mailto:hans@diet.er" rel="nofollow">hans@diet.er</a> stehen.</p>
<p>Ich habe hier meinen code</p>
<pre><code class="language-cpp">//INTERNET

#include &lt;windows.h&gt;
#include &lt;mapi.h&gt;
#include &lt;tchar.h&gt;
#include &lt;stdio.h&gt;

#define NUM_ELEMENTS(x)  (sizeof((x)) / sizeof((x)[0]))

int main(void)
{
  LPMAPISENDMAIL pfnSendMail;
  MapiRecipDesc  rdOriginator;
  MapiRecipDesc  rdRecipient[1];
  LPMAPILOGOFF   pfnLogoff;
  LPMAPILOGON    pfnLogon;
  MapiMessage    mapimsg;
  HINSTANCE      hDll;
  LHANDLE        lHnd;
  int ret;

    if(NULL == (hDll = LoadLibrary(TEXT(&quot;MAPI32.DLL&quot;))))
    {
        _tprintf(TEXT(&quot;could not load mapi32.dll, ErrorCode: %u&quot;), GetLastError());
        return(0);
    }

    pfnLogon    = (LPMAPILOGON)   GetProcAddress(hDll, &quot;MAPILogon&quot;);
    pfnLogoff   = (LPMAPILOGOFF)  GetProcAddress(hDll, &quot;MAPILogoff&quot;);
    pfnSendMail = (LPMAPISENDMAIL)GetProcAddress(hDll, &quot;MAPISendMail&quot;);

    ret = pfnLogon(0, &quot;SyD\0&quot;, NULL, 0, 0, &amp;lHnd);
	if( ret )
		printf( &quot;\npfnLogon&lt;%d&gt;\n&quot;, ret );

    mapimsg.ulReserved          = 0;
    mapimsg.lpszSubject         = &quot;This is a test&quot;;
    mapimsg.lpszNoteText        = &quot;This is the text&quot;;
    mapimsg.lpszMessageType     = NULL;
    mapimsg.lpszDateReceived    = NULL;
    mapimsg.lpszConversationID  = NULL;
    mapimsg.flFlags             = 0;
    mapimsg.lpOriginator        = &amp;rdOriginator;
    mapimsg.nRecipCount         = NUM_ELEMENTS(rdRecipient);
    mapimsg.lpRecips            = rdRecipient;
    mapimsg.nFileCount          = 0;
    mapimsg.lpFiles             = NULL;

    rdOriginator.ulReserved     = 0;
    rdOriginator.ulRecipClass   = MAPI_ORIG;
    rdOriginator.lpszName       = &quot;SyD@gmx.de&quot;;
    rdOriginator.lpszAddress    = &quot;SMTP:SMARTyourDisk12@gmx.de&quot;;
    rdOriginator.ulEIDSize      = 0;
    rdOriginator.lpEntryID      = NULL;

    rdRecipient[0].ulReserved   = 0;
    rdRecipient[0].ulRecipClass = MAPI_TO;
    rdRecipient[0].lpszName     = &quot;SyD@gmx.de&quot;;
    rdRecipient[0].lpszAddress  = &quot;SMTP:SMARTyourDisk@gmx.de&quot;;
    rdRecipient[0].ulEIDSize    = 0;
    rdRecipient[0].lpEntryID    = NULL;

    ret = pfnSendMail(lHnd, 0, &amp;mapimsg, 0, 0);
	if( ret )
		printf( &quot;\npfnSendMail&lt;%d&gt;\n&quot;, ret );

    ret = pfnLogoff(lHnd, 0, 0, 0);
	if( ret )
		printf( &quot;\npfnLogoff&lt;%d&gt;\n&quot;, ret );

    FreeLibrary(hDll);

	system(&quot;pause&quot;);

	return(0);
}
</code></pre>
<p>man beachte: ist nicht von mir entworfen, ich will nur testen ob das überhaupt machbar ist, danach werde ich alles kommentieren bis ichs peile <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> wobei dass ja noch geht.</p>
<p>Also was bei gmx ankommt ist &quot;Absender: meine.richtige@email.adresse&quot; und da soll ja eigentlich <a href="mailto:SMARTyourDisk@gmx.de" rel="nofollow">SMARTyourDisk@gmx.de</a> stehen oder!?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/208047/email-mit-c-senden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 10:44:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/208047.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Mar 2008 08:01:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Email mit !C! Senden on Fri, 14 Mar 2008 09:01:53 GMT]]></title><description><![CDATA[<p>Hi all,<br />
ich würde gerne ein Programm schreiben, was mit ANSI C geschrieben ist, und eine Email sendet.</p>
<p>Ich habe erst ein Thread in <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-207832.html" rel="nofollow">ANSI C</a> aufgemacht aber hier hätte es wohl hingehört, naja ich kanns ja nich verschieben und meiner Bitte dies zu tun wurde auch keine Folge geleistet <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>Ja ich habe mir jetzt mal eine gmx Emailadresse zugelegt und würde gerne zu dieser Emailadresse eine Email senden, und da soll als absender z.B. <a href="mailto:hans@diet.er" rel="nofollow">hans@diet.er</a> stehen.</p>
<p>Ich habe hier meinen code</p>
<pre><code class="language-cpp">//INTERNET

#include &lt;windows.h&gt;
#include &lt;mapi.h&gt;
#include &lt;tchar.h&gt;
#include &lt;stdio.h&gt;

#define NUM_ELEMENTS(x)  (sizeof((x)) / sizeof((x)[0]))

int main(void)
{
  LPMAPISENDMAIL pfnSendMail;
  MapiRecipDesc  rdOriginator;
  MapiRecipDesc  rdRecipient[1];
  LPMAPILOGOFF   pfnLogoff;
  LPMAPILOGON    pfnLogon;
  MapiMessage    mapimsg;
  HINSTANCE      hDll;
  LHANDLE        lHnd;
  int ret;

    if(NULL == (hDll = LoadLibrary(TEXT(&quot;MAPI32.DLL&quot;))))
    {
        _tprintf(TEXT(&quot;could not load mapi32.dll, ErrorCode: %u&quot;), GetLastError());
        return(0);
    }

    pfnLogon    = (LPMAPILOGON)   GetProcAddress(hDll, &quot;MAPILogon&quot;);
    pfnLogoff   = (LPMAPILOGOFF)  GetProcAddress(hDll, &quot;MAPILogoff&quot;);
    pfnSendMail = (LPMAPISENDMAIL)GetProcAddress(hDll, &quot;MAPISendMail&quot;);

    ret = pfnLogon(0, &quot;SyD\0&quot;, NULL, 0, 0, &amp;lHnd);
	if( ret )
		printf( &quot;\npfnLogon&lt;%d&gt;\n&quot;, ret );

    mapimsg.ulReserved          = 0;
    mapimsg.lpszSubject         = &quot;This is a test&quot;;
    mapimsg.lpszNoteText        = &quot;This is the text&quot;;
    mapimsg.lpszMessageType     = NULL;
    mapimsg.lpszDateReceived    = NULL;
    mapimsg.lpszConversationID  = NULL;
    mapimsg.flFlags             = 0;
    mapimsg.lpOriginator        = &amp;rdOriginator;
    mapimsg.nRecipCount         = NUM_ELEMENTS(rdRecipient);
    mapimsg.lpRecips            = rdRecipient;
    mapimsg.nFileCount          = 0;
    mapimsg.lpFiles             = NULL;

    rdOriginator.ulReserved     = 0;
    rdOriginator.ulRecipClass   = MAPI_ORIG;
    rdOriginator.lpszName       = &quot;SyD@gmx.de&quot;;
    rdOriginator.lpszAddress    = &quot;SMTP:SMARTyourDisk12@gmx.de&quot;;
    rdOriginator.ulEIDSize      = 0;
    rdOriginator.lpEntryID      = NULL;

    rdRecipient[0].ulReserved   = 0;
    rdRecipient[0].ulRecipClass = MAPI_TO;
    rdRecipient[0].lpszName     = &quot;SyD@gmx.de&quot;;
    rdRecipient[0].lpszAddress  = &quot;SMTP:SMARTyourDisk@gmx.de&quot;;
    rdRecipient[0].ulEIDSize    = 0;
    rdRecipient[0].lpEntryID    = NULL;

    ret = pfnSendMail(lHnd, 0, &amp;mapimsg, 0, 0);
	if( ret )
		printf( &quot;\npfnSendMail&lt;%d&gt;\n&quot;, ret );

    ret = pfnLogoff(lHnd, 0, 0, 0);
	if( ret )
		printf( &quot;\npfnLogoff&lt;%d&gt;\n&quot;, ret );

    FreeLibrary(hDll);

	system(&quot;pause&quot;);

	return(0);
}
</code></pre>
<p>man beachte: ist nicht von mir entworfen, ich will nur testen ob das überhaupt machbar ist, danach werde ich alles kommentieren bis ichs peile <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> wobei dass ja noch geht.</p>
<p>Also was bei gmx ankommt ist &quot;Absender: meine.richtige@email.adresse&quot; und da soll ja eigentlich <a href="mailto:SMARTyourDisk@gmx.de" rel="nofollow">SMARTyourDisk@gmx.de</a> stehen oder!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1474078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1474078</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Fri, 14 Mar 2008 09:01:53 GMT</pubDate></item><item><title><![CDATA[Reply to Email mit !C! Senden on Fri, 14 Mar 2008 10:28:41 GMT]]></title><description><![CDATA[<p>bitte closen. &lt;&lt; hat sich erledigt, diese funktionalität wird weiterhin genutzt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1474174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1474174</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Fri, 14 Mar 2008 10:28:41 GMT</pubDate></item><item><title><![CDATA[Reply to Email mit !C! Senden on Fri, 14 Mar 2008 10:33:34 GMT]]></title><description><![CDATA[<p>Welche &quot;Funktionalität&quot;?? Scheint als könne man so aber keine<br />
Attachments mitsenden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1474177</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1474177</guid><dc:creator><![CDATA[Shell32off]]></dc:creator><pubDate>Fri, 14 Mar 2008 10:33:34 GMT</pubDate></item><item><title><![CDATA[Reply to Email mit !C! Senden on Fri, 14 Mar 2008 12:11:49 GMT]]></title><description><![CDATA[<p>Doch kann man,</p>
<pre><code class="language-cpp">mapimsg.nFileCount          = 0;//&lt;&lt;anzahld der Dateien
		    mapimsg.lpFiles             = NULL;//&lt;&lt;Dateiliste[wie genau das geht, ka]
</code></pre>
<p>Ich hatte gehoft man kann anders als über WinAPI senden, also ohne MAPI zumindest.<br />
Aber erstmal funktionierts, das problem ist jetzt wo anders, hat mit dieser Funktionalität nichts zu tun.</p>
<p>Danke an alle die mir geholfen haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1474237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1474237</guid><dc:creator><![CDATA[lippoliv]]></dc:creator><pubDate>Fri, 14 Mar 2008 12:11:49 GMT</pubDate></item></channel></rss>