Search results for 'SmtpMail'. 2 post(s) found.
- 2007/10/04 Sending email messages in .Net
- 2007/08/26 Send Email Using C#
Sending an e-mail message (even with attachments) in Delphi for .NET (ASP.NET or WinForms) is very simple. You don't have to learn complicated syntaxes and other commands to achieve the task. The System.Web.Mail namespace provides the classes for sending email in .NET. MailMessage class manages the mail message contents; SmtpMail class sends email to the mail server.
Here's a sample code:
uses System.Web.Mail;
...
var
MailMessage : System.Web.MailMessage;
begin
MailMessage := MailMessage.create;
try
with MailMessage do
begin
From := 'delphi.guide@about.com';
&To := 'someone@somewhere.net';
Subject := 'This is the subject line';
Body := 'this is the mail body text;
BodyFormat := System.Web.Mail.MailFormat.Text;
end;
SmtpMail.SmtpServer := 'SmtpServer NAME';
SmtpMail.Send(MailMessage) ;
except on e : Exception do
MsgResult.Text := 'Error occured!';
end;
end;
...
var
MailMessage : System.Web.MailMessage;
begin
MailMessage := MailMessage.create;
try
with MailMessage do
begin
From := 'delphi.guide@about.com';
&To := 'someone@somewhere.net';
Subject := 'This is the subject line';
Body := 'this is the mail body text;
BodyFormat := System.Web.Mail.MailFormat.Text;
end;
SmtpMail.SmtpServer := 'SmtpServer NAME';
SmtpMail.Send(MailMessage) ;
except on e : Exception do
MsgResult.Text := 'Error occured!';
end;
end;
Another posts included in "Delphi"
| Find File at certain directory in Delphi (0) | 2008/10/10 |
| How to turn off monitor ? (0) | 2008/12/10 |
| How to get screen resolution in case of using multiple monitors ? (0) | 2008/12/16 |
| Implementing C#'s foreach loop in Delphi 8 (0) | 2007/10/04 |
| Delphi for .Net Code Folding keyboard shortcuts (0) | 2007/10/04 |
| How to encrypt a string (0) | 2007/10/04 |
| Creating thumbnail images (0) | 2007/10/04 |
| Technology sharing related with software development. Specially content... (0) | 2007/10/02 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:56
moneyideas
-
Subject different money making ideas
2010/01/29 14:30
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
A code snippet,posted on the dotnet newsgroup,about how to send email using C#.
<%@Import <mailto:%@Import> namespace="System.Web.Util"%>
try{
MailMessage MyMail = new MailMessage();
MyMail.To = "who";
MyMail.From = "you";
MyMail.BodyFormat = MailFormat.Html;
MyMail.Body = "sometext";
SmtpMail.Send(MyMail);
}
catch(Exception){}
try{
MailMessage MyMail = new MailMessage();
MyMail.To = "who";
MyMail.From = "you";
MyMail.BodyFormat = MailFormat.Html;
MyMail.Body = "sometext";
SmtpMail.Send(MyMail);
}
catch(Exception){}
Another posts included in "C#"
| How to call Visual C/C++ implemented DLL functions in C# - Simple DLLIm... (0) | 2007/08/26 |
| Create PDF Files On the Fly In C Sharp (0) | 2007/08/27 |
| Queue Tutorial In C# (0) | 2007/08/27 |
| How To Read And Write A Cookie (0) | 2007/08/26 |
| Using C# With Cookies (0) | 2007/08/26 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:13
moneyideas
-
Subject different money making ideas
2010/01/29 08:38
moneyideas
-
Subject different money making ideas
2010/01/31 16:43
moneyideas

Prev

Rss Feed