473,385 Members | 1,555 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,385 software developers and data experts.

about mail?

How can I send a mail from my C# app but not via Outlook or OutlookExpress?
Nov 16 '05 #1
3 1095
See
http://www.systemwebmail.com/

Specifically Faq section #2

--
-Philip Rieck
http://philiprieck.com/blog/

-
"cfyam" <cf***@mail.apol.com.tw.NOSPAN> wrote in message
news:uj**************@TK2MSFTNGP14.phx.gbl...
How can I send a mail from my C# app but not via Outlook or
OutlookExpress?

Nov 16 '05 #2
hi
you can use
MailMessage and SmtpMail class to send mails
These are in the System.Web.Mail name space
regards
Ansil

"cfyam" wrote:
How can I send a mail from my C# app but not via Outlook or OutlookExpress?

Nov 16 '05 #3
using System.Web.Mail;

public static Boolean EnviarMail(string To, string From, string
Subject, string Body, string Servidor)
{
try
{
try
{
MailMessage Message = new MailMessage();
Message.To = To;
Message.From = From;
Message.Subject = Subject;
Message.Body = Body;

try
{
SmtpMail.SmtpServer = Servidor;
SmtpMail.Send(Message);
}
catch(System.Web.HttpException ehttp)
{
//Console.WriteLine("{0}", ehttp.Message);
//Console.WriteLine("Here is the full error message output");
//Console.Write("{0}", ehttp.ToString());
return false;
}
}
catch(IndexOutOfRangeException)
{
return false;
}
}
catch(System.Exception e)
{
//Console.WriteLine("Unknown Exception occurred {0}", e.Message);
//Console.WriteLine("Here is the Full Message output");
//Console.WriteLine("{0}", e.ToString());
return false;
}
return true;
}
Nov 16 '05 #4

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

Similar topics

12
by: Chris Dewin | last post by:
Hi. I've been thinking about using smtplib to run a mailing list from my website. s = smtplib.SMTP("server") s.sendmail(fromaddress, toaddresess, msg) I know that in this instance, the...
97
by: Cameron Laird | last post by:
QOTW: "Python makes it easy to implement algorithms." - casevh "Most of the discussion of immutables here seems to be caused by newcomers wanting to copy an idiom from another language which...
12
by: cj | last post by:
What's the parameter (like ?attachment) or something.
6
by: Hemant Shah | last post by:
Folks, Today, I was exporting a table in one database and then importing it in another database. The table in destination database was missing one column (my mistake while creating the table),...
0
by: sigexfoundry | last post by:
First of all, I'd like to appologise for the noise and for cross-posting. This is my first and last e-mail on this list. As you may have noticed from the subject of the e-mail, I'm about to speak...
5
by: rengaraj | last post by:
Hello , I try a simple javamail program to send a mail.When i execute that javamail program, i got the error as follows import java.util.*; import javax.mail.*; import...
5
by: muddasirmunir | last post by:
I want to ask question about yahoo mail. I had created a new email id with the name of my company let say maycompany@yamail.com Now, while making email I put my name in the fields asked by...
1
by: AcidAndroid | last post by:
This question is in regards to this article. Hi, you code works fine , but i have a trouble reading the mails talking about "undelivery mail" you know when you get a mail when you send a mail to...
5
by: jeddiki | last post by:
I am building my subscriber list which is held in the mySQL database "client" table and I want to start sending them a newsletter. My list will probably get up to around 20,000 I would like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.