473,776 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send an email from a Web Service without having an SMTP server.

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 an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?
Thanks,
Luigi.
Jun 11 '07 #1
3 2881
On Jun 11, 11:05 pm, "BLUE" <bluewrote:
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 an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?

Thanks,
Luigi.
We can use MailMessage class. See http://www.developer.com/net/net/article.php/3511731

But we need to provide the host name, I mean the mailserver name.

Jun 11 '07 #2
On Jun 11, 9:05 pm, "BLUE" <bluewrote:
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 an
SMTP server like if I am myself an SMTP server that is forwarding a mail.

What classes can be used on .NET FW 2?

Thanks,
Luigi.
Hi,

I don't think you can avoid connection to an existing SMTP server.
Email forwarding is made by an SMTP server...

If you don't want to be an SMTP server and send mails at the same
time, it's not possible.

If you have an SMTP server to send the mail with, use the
System.Net.Mail namespace MailMessage & SmtpClient classes to deliver
mail messages.
Otherwise, if you want to implement an SMTP server, you should follow
the RFC for SMTP servers and the section of email forwarding.

Hope this helps.
Moty

Jun 11 '07 #3
Using mx1.mail.yahoo. com my message is refused: is there an SMTP with wich
to try?
I'm not sure SmtpClient do not behave like an email client: smtp servers
send messages all over the world without authenticating each other.
If I set UseDefaultCrede ntials to true
System.Net.Cred entialCache.Def aultCredentials are sent, but how can I see
what credentials are sent?
I've seen GetCredential, but I do not know how to set the parameters.
Thanks,
Luigi.
Jun 12 '07 #4

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

Similar topics

11
12091
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to use PHP to get inside an OWA (Microsoft Outlook Web Access) website to send email that way? The reason I ask is because my corporate office is going to do away with our rogue SMTP server access and force everything through Exchange
6
3260
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 my customers are not really happy with having the IIS installed, not being used except to send e-mail this is becoming a problem. I have also tried using a little program from code project for sending e-mail which works great on older servers...
1
6291
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 SmtpMail.Send"mymail@gmx.net", "somebody@xxx.ch", "sub",
3
3036
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 identifies itself as the computer name which is not in domain.com format, triggering spam filter problems). Instead, I want to have my code send through an SMTP server of a company that we pay for mail service. But they require a username and password....
3
5011
by: rob | last post by:
I have an win form app from which I want to be able to send bug reports. My first approach was something like: SmtpClient client = new SmtpClient( ????? ); MailAddress from = new MailAddress("from@from.com"); MailAddress to = new MailAddress("to@to.com"); MailMessage message = new MailMessage(from, to); message.Body = "Email Body"; message.BodyEncoding = System.Text.Encoding.UTF8; message.Subject = "Subject";
4
2260
by: CLEAR-RCIC | last post by:
I want to send an email from our Intranet site to myself whenever an error happens. Our manager will not let us install SMTP on the web server. Is it possible to send email programatically without SMTP installed?
11
7730
by: hazz | last post by:
smtpClient.Send(message) is causing me problems as per specifics in the trace below. Email is sent but not without this error typically upon sending the second email, but sometimes when running the app, even the first time. The application will be required to be sending out repeated emails, about one every second or two. Must this be done asynchronously? Thank you. -Greg I get the generic error messages;
5
4223
by: Sin Jeong-hun | last post by:
Hi. I would like to let users send bug reports or other messages to me. Maybe the easiest way to send e-mails from my application is just use the default e-mail agent by executing a link mailto://mymail@domail.com. But this only works if the user has configured Outlook or something. Many users use web-based mails here so if I do so, Outlook Express's a new account wizard will pop-up. Futhure more this reveals user e-mails. Some people...
2
3836
by: btcoder | last post by:
Hi, my jsp page uses sun.net.smtp.SmtpClient to send email. It worked fine until the hosted location was moved to another server. Now it generates the sun.net.smtp.SmtpProtocolException and the hosting company can't find what's wrong with it so I'm here hoping somebody can help. The hosting company tried sending email from the server and it was okay and found no restrictions that prevents my page to access the smtp server. What could cause...
0
9464
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10289
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10061
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8952
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3622
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.