473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Send Mail from Web Service

Hi,
I need to send a mail message from a web service.
If i execute the code from a Windows Form Application the message is
sended correctly but if i execute the same code from a web service an
exception is throwed "Could not access 'CDO.Message' object".

That's the code:

Public Sub Send()
Try
Dim i As String
Dim m As New MailMessage
m.BodyEncoding = System.Text.Encoding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.Normal

m.Subject = "Hello"
m.To = "us***@company.com"
m.From = "us***@company.com"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.com"
ss.Send(m)
Catch ex As Exception
Debug.Write("Error: " & ex.Message)
End Try
End Sub

Why?
I need special permission?
I miss something?

Thanks

Michele

Nov 19 '05 #1
1 1496
Hi,

Check out the following link.
http://www.systemwebmail.com/faq/4.2.3.aspx#4.2.3

HTH
Ken

<mm******@omniway.sm> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,
I need to send a mail message from a web service.
If i execute the code from a Windows Form Application the message is
sended correctly but if i execute the same code from a web service an
exception is throwed "Could not access 'CDO.Message' object".

That's the code:

Public Sub Send()
Try
Dim i As String
Dim m As New MailMessage
m.BodyEncoding = System.Text.Encoding.UTF8
m.BodyFormat = MailFormat.Html
m.Priority = MailPriority.Normal

m.Subject = "Hello"
m.To = "us***@company.com"
m.From = "us***@company.com"
m.Body = "Hello world"
Dim ss As SmtpMail
ss.SmtpServer = "mail.company.com"
ss.Send(m)
Catch ex As Exception
Debug.Write("Error: " & ex.Message)
End Try
End Sub

Why?
I need special permission?
I miss something?

Thanks

Michele

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Yllar2003 | last post by:
Hi! Perhaps slightly off-topic but... I want to implement a function to send emails to the registered users from my web site using ASP. The problem is that the web server provider I'm using...
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
1
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
4
by: Morten Snedker | last post by:
Using the procedure below on an ordinary form works fine. Moving it to a service-project makes it fail on SmtpMail.Send(mail) with error: "Could not access 'CDO Message' object." Google-search...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
3
by: BLUE | last post by:
I want to send an email from my web service. I do not want to act like an email client, giving credentials of an existing email account to send messages: I would like to send my mail directly to...
1
by: Vijay | last post by:
Hi, I have a problem to send Mail in ASP. I am using CDO for sending mail. My Server configuration are : Windows Server 2003 Stadndard Edition with R2, Service Pack 2, Microsoft Management...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.