sending email from vc++
-
How can I send email from a program? I would like to not have to go through an SMTP server. On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked. Thank you for suggestions, -Alex Griffing
-
How can I send email from a program? I would like to not have to go through an SMTP server. On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked. Thank you for suggestions, -Alex Griffing
See this: http://www.codeproject.com/useritems/xymailclient.asp I vote pro drink :beer:
-
How can I send email from a program? I would like to not have to go through an SMTP server. On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked. Thank you for suggestions, -Alex Griffing
Hey Alex, Well, I suppose you have few choices. MAPI If you are willing to rely on the MAPI subsystem in Windows, you can certainly use MAPI to deliver the email. There can be issues with using MAPI from within NT Services (I guess we need to start calling these something else now with the advent of 2000 and XP), not sure if this is part of your objective. Depending on how and where your software will be distributed, it can also be problematic to ensure that your clients will configure MAPI properly. Mapi works well however, when everything is configured and running. DUMB SMTP There are lots of basic SMTP mail classes and code around, so if you don't need attachments, rich content, MIME etc., and you know you have access to a set up and working "smart" SMTP host, you could use something like this. Setup here too can be a little tricky. Your clients need to provide the name of the smart host, there really isn't any way to auto detect this. SMART SMTP ** warning: I'm going to plug a product from my company :) Depending on your needs, an option could be to use a comprehensive library like our Dundas TCP/IP toolkit. The toolkit includes all the SMTP and MIME stuff to handle attachments, rich content, etc., and it is also smart enough to be able to deliver the outgoing email directly to the recipients email server (no need for a relay host). The toolkit is 100% C++ and provided as source code, so it compiles right into your .exe w/o any external dependencies. Check it out: http://www.dundas.com/index.asp?products/tcpip/index.asp HTH, David
-
How can I send email from a program? I would like to not have to go through an SMTP server. On a related note, but off topic for this forum, I set up an SMTP server on my computer but when I tried to email my hotmail account through it, it said that it was 'unable to relay' for that email address. On the 'relay restrictions' page of the internet information services settings I have the 'Allow all computers which successfully authenticate to relay' check box checked. Thank you for suggestions, -Alex Griffing
You've got 2 choices: * MAPI (yuk) * SMTP (easy) I've done both -- and neither are great. SMTP has turned out to be easier, but you gotta learn the protocol. MAPI is a pain.... MAPI is a little more memory intensive, by making those memory calls, all of the MAPI suport gets loaded. SMTP only needs to load winsock... As for your main problem -- it seems that you've not actually authenticated. -p