Some time our emails bounce from SMTP SERVER. when i analysis the problem i got three way to send mail. with free SMTP SERVER like gmail. etc server OR USING CDOSYS OR CDONTS. BUT the question: "Why should I switch to CDOSYS when my current CDONTS code works great?". Let me give a few reasons:
* CDONTS has been deprecated in IIS5 and is completely removed from Windows Server 2003, and even Windows XP. Yes, it is
possible to install on Windows Server 2003 but with the performance improvements and other enhancements, there should be no
need to do so.
* CDOSYS carries less overhead than CDONTS.
* HTML functionality is much improved with automatic generation of the TextBody by just setting the HTMLBody property.
* There are some new properties and methods that should have been included with CDONTS but weren't.
in my earlier post i already explain the code of send mail via gmail server so now we will focus on.
USE CDONTS.DLL
STEP 1) AS WE DESCRIBED ABOVE THAT CDONTS.DLL ARE NO MORE OVER IN WINDOW FOLDER SO CONFIGURE IT WHITH THIS WAY
Start + Run, regsvr32 c:\cdonts.dll
OR
Start + Run + cmd,
in command type and run
]regsvr32 [path for dll]
now add refference of cdonts.dll
CDONTS.NewMail mailsend1 = new CDONTS.NewMail();
string From = "helpondesk@blogspot.com";
string Subject = "xxxxxxxxxxxxxxxxxxxxxx";
string Body = "[html][body][table border=0 cellpading=0 cellspacing=0][tr][td]hi from
cdonts[/td][/tr][/table][/body][/html]";
string To = "helpondesk@blogspot.com";
mailsend1.BodyFormat = 0;
mailsend1.MailFormat = 0;
mailsend1.Importance = Convert.ToInt32(CDONTS.CdoImportance.CdoHigh);
mailsend1.Send(From, To, Subject, Body, 1);
how to implement second dll CDOSYS
we can also configure cdosys dll with same way as codonts.dll
using System.Web.Mail;
MailMessage eMail = new MailMessage();
eMail.To = "helpondesk@blogspot.com";
eMail.Subject = " 2222222222";
eMail.Body = "[html][table][tr][td]HI THIS MAIL FROM CDOSYS SO HOW ARE YOU[/td][/tr][/table]";
// Smtp configuration
eMail.From = "helpondesk@blogspot.com";
eMail.Fields.Add(CDO.CdoConfiguration.cdoSMTPAuthenticate, "1");
eMail.Fields.Add(CDO.CdoConfiguration.cdoSendUserName, "helpondesk@blogspot.com");
eMail.Fields.Add(CDO.CdoConfiguration.cdoSendPassword, "mypwd");
SmtpMail.SmtpServer = "smpt.domain.com";
eMail.BodyFormat = MailFormat.Html;
SmtpMail.Send(eMail);
Thanks
HelpOnDesk Team
Friday, January 2, 2009
Thursday, January 1, 2009
Using PayPal Pro With ASP.Net application
Hi Everybody..
"How to use PayPal Pro Method in Asp.Net 2.0 web Application", this is topic for today which, I want to add as my latest post .I hope all of you are well aware of this.Yet I am adding this for quick reference.
You can also take an idea from HERE .
You have to add the following code in your page and modified it as per your need...
protected void Page_Load(object sender, EventArgs e)
{
// Do Your Other Task Here...
UpdatePaymentStatus();
}
protected void UpdatePaymentStatus()
{
#region Paypal Return
try
{
string status = GetSuccessStatus();
if (status != null && status != string.Empty)
{
if (status.Contains("success"))
{
// Do Your DatBase related things ag save the transaction details in DB
// for eg: userID ,Unit Price,And Total Amount or anyother thing as needed
}
if (status.Contains("failed"))
{
// do as per your Logic
}
}
}
catch (Exception Ex)
{
Session["errorMessage"] = Ex.Message.ToString();
//Response.Redirect("index.aspx");
}
#endregion
}
protected void ImgPayMent_Click(object sender, ImageClickEventArgs e)
{
amount = Convert.ToDouble(lblPrice.Text);
string redirect = "";
//redirect += "https://www.paypal.com/cgi-bin/webscr";
redirect += "https://www.sandbox.paypal.com/cgi-bin/webscr";
redirect += "?cmd=_xclick";
redirect += "&business=books._1235082065_biz@gmail.com ";
//Where abc@youdomain.com is Merchant account ID
redirect += "&item_name=" + "My Testing Purpose";
redirect += "&item_number=1";
redirect += "&amount=" + String.Format("{0:0.00} ", amount);// This is amount Double Type
redirect += "¤cy_code=USD";
redirect += "&no_shipping=1";
redirect += "&no_note=1";
redirect += "&return=http://HomeUrlOfSite/Purchase.aspx/success/";
redirect += "&cancel_return=http://HomeUrlOfSite/Purchase.aspx/failed/"
Response.Redirect(redirect);
}
protected string GetSuccessStatus()
{
if (Request.PathInfo.Length == 0)
return "";
else if (Request.PathInfo.Contains("success"))
return "success";
else if (Request.PathInfo.Contains("failed"))
return "failed";
return "";
}
}
Thanks:...
Sanjeev Kumar
HelpOnDesk Team
"How to use PayPal Pro Method in Asp.Net 2.0 web Application", this is topic for today which, I want to add as my latest post .I hope all of you are well aware of this.Yet I am adding this for quick reference.
You can also take an idea from HERE .
You have to add the following code in your page and modified it as per your need...
protected void Page_Load(object sender, EventArgs e)
{
// Do Your Other Task Here...
UpdatePaymentStatus();
}
protected void UpdatePaymentStatus()
{
#region Paypal Return
try
{
string status = GetSuccessStatus();
if (status != null && status != string.Empty)
{
if (status.Contains("success"))
{
// Do Your DatBase related things ag save the transaction details in DB
// for eg: userID ,Unit Price,And Total Amount or anyother thing as needed
}
if (status.Contains("failed"))
{
// do as per your Logic
}
}
}
catch (Exception Ex)
{
Session["errorMessage"] = Ex.Message.ToString();
//Response.Redirect("index.aspx");
}
#endregion
}
protected void ImgPayMent_Click(object sender, ImageClickEventArgs e)
{
amount = Convert.ToDouble(lblPrice.Text);
string redirect = "";
//redirect += "https://www.paypal.com/cgi-bin/webscr";
redirect += "https://www.sandbox.paypal.com/cgi-bin/webscr";
redirect += "?cmd=_xclick";
redirect += "&business=books._1235082065_biz@gmail.com ";
//Where abc@youdomain.com is Merchant account ID
redirect += "&item_name=" + "My Testing Purpose";
redirect += "&item_number=1";
redirect += "&amount=" + String.Format("{0:0.00} ", amount);// This is amount Double Type
redirect += "¤cy_code=USD";
redirect += "&no_shipping=1";
redirect += "&no_note=1";
redirect += "&return=http://HomeUrlOfSite/Purchase.aspx/success/";
redirect += "&cancel_return=http://HomeUrlOfSite/Purchase.aspx/failed/"
Response.Redirect(redirect);
}
protected string GetSuccessStatus()
{
if (Request.PathInfo.Length == 0)
return "";
else if (Request.PathInfo.Contains("success"))
return "success";
else if (Request.PathInfo.Contains("failed"))
return "failed";
return "";
}
}
Thanks:...
Sanjeev Kumar
HelpOnDesk Team
Subscribe to:
Posts (Atom)