Hi ,
thank you for your advise, which looks promising. I'll describe to you the context of the problem in greater detail, if I may.
On the webserver, I have disabled the SMTP service. I have been using MailEnable Standard Edition, a free email server. I do this basically because I dont understand how mail is send from Windows Server. It all works fine in our development environment here-emails are sent from the webserver to eg my Yahoo account, gmail account etc with no problems. However, in my client's site (a larger medical device company in Ireland), the emails appear to be sent (there is no crashing on sending), but they never arrive at their destination. Their SMTP server is in Belgium.
Should I
(1) remove MailEnable
(2) install the SMTP service on the webserver
(3) create a new domain (selecting the Remote option)
(4) naming it the dns name of the mailserver
(5) selecting Allow incoming mail to be relayed to this domain
(6) select the forward all mail to smarthost option, specifying the ip address of the mail server in belgium
Regards!
==============================================================
The issue is likely to be permissions related i.e. the user your asp.net application is running under (aspnet/networkuser) cannot access the COM components. This is correct behaviour (otherwise anonymous websites could access dangerous com components). If it's an internal setup, you could disable anonymous authentication, and run the asp.net application under a particular user (using impresonation), and then try it.
I'd recommend that you don't do that as theres a number of issues
1) outlook will popup a prompt you can't disable as it's setup to not allow automatic mail by default (to protect against spam).
2) it's insecure (COM requires fulltrust code access security)
Please try the mail classes as recommended. If you're not getting an error the mail is working, but the smtp forwarding is not. If you open the IIS MMC, you'll see a node for SMTP, to forward the mail to a mail server. If you've got a mail server such as Exchange, then this is often best to use the smarthost setting. Alternatively, this is a good reference to set this up. Once it's working correctly, the queued messages will automatically send.
Cathal
====================================================================
Hello,
I want to send an email via Outlook 2003 (SP1) from an asp.net page. I have
tried using the SMTP classes as recommended by Microsoft, but the environment
of my client, the email messages never arrive when sent using this method;
hense using MS Otlook on the wenserver. The code is below:
Dim oApp As Microsoft.Office.Interop.Outlook.Application
oApp = New Microsoft.Office.Interop.Outlook.Application
' Create a new MailItem.
Dim oMsg As Microsoft.Office.Interop.Outlook.MailItem
oMsg =
CType(oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem), Microsoft.Office.Interop.Outlook.MailItem)
oMsg.Subject = "Hello!!!"
oMsg.Body = "Hello World"
oMsg.To = "me@gmail.com"
oMsg.Send()
The code runs fine in the Visual Studio 2005 development web server, but a
security error is thrown on publishing to iis 6 (on windows server sp1):
Retrieving the COM class factory for component with CLSID
{0006F03A-0000-0000-C000-000000000046} failed with HRESULT: 0x80070005(Access
is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))).
Can anyone advise