Dynamicweb 8 Documentation
SendTo(PageView,String,String,String,Template) Method
Example 

The page view.
The order ID.
To mail address.
From mail address.
The mail template.
Sends the mail to the specified adress.
Syntax
'Declaration
 
Public Overloads Shared Function SendTo( _ 
   ByRef PageView As PageView, _ 
   ByVal OrderID As String, _ 
   ByVal ToMailAddress As String, _ 
   ByVal FromMailAddress As String, _ 
   ByRef MailTemplate As Template _ 
) As Boolean
public static bool SendTo( 
   ref PageView PageView,
   string OrderID,
   string ToMailAddress,
   string FromMailAddress,
   ref Template MailTemplate 
)

Parameters

PageView
The page view.
OrderID
The order ID.
ToMailAddress
To mail address.
FromMailAddress
From mail address.
MailTemplate
The mail template.
Example
class MyPage : System.Web.UI.Page
{
   public void SendMails(ref Dynamicweb.eCommerce.CustomerCenter.CustomerCenterSettings Settings, ref Dynamicweb.Frontend.PageView pageView)
   {
       string addresses = Base.Request("Addresses");
       if (!string.IsNullOrEmpty(addresses))
       {
           string[] emailAddresses = addresses.Split(':');
           string oid = Base.Request("OrderID");

           string SenderMail = Settings.DefaultMailAddress.Trim();
           if (string.IsNullOrEmpty(SenderMail) || Base.ValidateEmail(SenderMail) == false)
           {
               SenderMail = Convert.ToString(Base.GetGs("/Globalsettings/Settings/CommonInformation/Email"));
               if (Base.ValidateEmail(SenderMail) == false)
               {
                   SenderMail = "noreply@dynamicweb-cms.com";
               }
           }
           if (!string.IsNullOrEmpty(oid))
           {
               Order tmpOrder = Dynamicweb.eCommerce.CustomerCenter.OrderManager.GetOrderForCurrentUser(oid);
               if (tmpOrder != null)
               {
                   Dynamicweb.eCommerce.Shops.Shop shop = new Dynamicweb.eCommerce.Shops.Shop(tmpOrder.ShopID);

                   for (int cnt = emailAddresses.GetLowerBound(0); cnt <= emailAddresses.GetUpperBound(0); cnt++)
                   {
                       Dynamicweb.Rendering.Template t = new Dynamicweb.Rendering.Template(Settings.MyOrderDetailsTemplate);
                       Order.SendTo(ref pageView, oid, emailAddresses[cnt], SenderMail, ref t);
                   }
               }
               else
               {
                   return;
               }
           }
       }
   }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Order Class
Order Members
Overload List

Send Feedback