choose language::
HOME
NOUTATI
DESPRE NOI
F.A.Q.
CARIERE
CONTACT
  


 
 
 webdesign  e-commerce  backup online
       F.A.Q.

  1. Cum trimit un mail in ASP?
  2. Cum trimit un mail in PHP?
  3. Cum trimit un mail in ASP.NET?

1. Cum trimit un mail in ASP?

<%


Set myMail = Server.CreateObject("CDO.Message")

Set config = Server.CreateObject("CDO.Configuration")
Set Flds = config.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver")="localhost"

Set myMail.Configuration = config

myMail.From = "the sender email"
myMail.To = "the recipient email"
myMail.CC = "the CC email"
myMail.BCC = "the BCC email"
myMail.Subject = "the email subject"

myMail.HTMLBody = "the text/html portion of message body"
myMail.TextBody = "the text/plain portion of message body"

myMail.Send
Set myMail = nothing

%>

  sus

2. Cum trimit un mail in PHP?

<?

$message = new COM("CDO.Message");

$config = new COM("CDO.Configuration");
$config->Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"]->value=2;
$config->Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"]->value="localhost"; $config->Fields->Update();

$message->Configuration = $config;

$message->To = "the recipient email";
$message->CC = "the CC email";
$message->BCC = "the BCC email";
$message->From = "the sender email";
$message->Subject = "the email subject";

$message->HTMLBody ="the text/html portion of message body";
$message->TextBody ="the text/plain portion of message body";

$message->Send();

?>

  sus

3. Cum trimit un mail in ASP.NET?

  • VB.NET

Dim objMail As New System.Web.Mail.MailMessage
With objMail
.From = "the sender email"
.To = "the recipient email"
.Cc = "the CC email"
.Bcc = "the BCC email"

.BodyFormat = Mail.MailFormat.Html 'this is a text/html format

or


.BodyFormat = Mail.MailFormat.Text 'this is a text/plain format
.Subject = "the email subject"
.Body = "the email body"
End With

System.Web.Mail.SmtpMail.SmtpServer = "localhost"
System.Web.Mail.SmtpMail.Send(objMail)

  • C#

System.Web.Mail.MailMessage objMail = new System.Web.Mail.MailMessage();

objMail.From = "the sender email";
objMail.To = "the recipient email";
objMail.Cc = "the CC email";
objMail.Bcc = "the BCC email";

objMail.BodyFormat = Mail.MailFormat.Html; 'this is a text/html format

or


objMail.BodyFormat = Mail.MailFormat.Text; 'this is a text/plain format
objMail.Subject = "the_email subject";
objMail.Body = "the email body";

System.Web.Mail.SmtpMail.SmtpServer = "localhost";
System.Web.Mail.SmtpMail.Send(objMail);

  sus


Intrebarea ta:

home | noutati | despre noi | cariere | contact
webdesign | magazin virtual | backup online

Copyright © 2005 Dion. Toate drepturile rezervate.