服务器不支持安全连接Godaddy Host

时间:2017-05-14 18:21:10

标签: asp.net gridview

我的网站是我要发送的购物车 Gridview通过Godaddy Server发送电子邮件,但此错误显示"服务器不支持安全连接"我发送文本时没有问题我收到了电子邮件,但是当添加Gridview这个错误时显示



<asp:GridView ID="GridView1" runat="server" 
        EnableModelValidation="True" GridLines="Horizontal" AutoGenerateColumns="False" 
                            AllowPaging="True" Width="790px" CssClass="table table-bordered" >
    <Columns>
        
      
      
     
        <asp:CommandField HeaderText="" ShowDeleteButton="True" 
            ShowEditButton="True" ShowHeader="True" CancelText="الغاء" 
            DeleteText="حذف" EditText="تعديل" NewText="جديد" UpdateText="تحديث" >
      
      
        <ItemStyle Font-Size="10pt" ForeColor="#F96405" />
        </asp:CommandField>
      
      
     
         <asp:BoundField DataField="CategoryId" HeaderText="رقم المنتج " ReadOnly="True" />
         <asp:BoundField DataField="Id" HeaderText="رقم الصنف" ReadOnly="True" />
      
      
         <asp:TemplateField HeaderText=" الصوره">
             <EditItemTemplate>
                 <asp:Label ID="Label1" runat="server" Text='<%# Eval("MainImage") %>' class="cart_product first_item"></asp:Label>
             </EditItemTemplate>
             <ItemTemplate>
              
                 <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("MainImage") %>' Width="100" Height="100"  />
             </ItemTemplate>
         </asp:TemplateField>
      
      
        <asp:BoundField DataField="DetailsAr" HeaderText="التفاصيل" ReadOnly="True" HtmlEncode="false" />
        
        <asp:BoundField DataField="TitleAr" HeaderText="العنوان" ReadOnly="True" HtmlEncode="false" />
      
      <asp:BoundField DataField="Qty" HeaderText="الكميه" ReadOnly="false" ControlStyle-CssClass="cart_quantity item text-center" />
        <asp:BoundField DataField="priceAfter" HeaderText="السعر" ReadOnly="True" ControlStyle-CssClass="cart_unit item text-right" />
        
      
         <asp:BoundField DataField="subtotal" HeaderText="المجموع" ReadOnly="True" ControlStyle-CssClass="cart_total item text-right" />
        
      
    </Columns>
    <EmptyDataTemplate>
        السله فارغه اضف بعض المنتجات
        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Dafault.aspx">العوده للتسوق</asp:HyperLink>
    </EmptyDataTemplate>
    <FooterStyle BackColor="White" ForeColor="#333333" />
    <HeaderStyle />
    <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle  />
    <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
    </asp:GridView>
&#13;
&#13;
&#13;

 public void SendHTMLMail()
    {
        MailMessage Msg = new MailMessage();
        MailAddress fromMail = new MailAddress("myemail@server.com");
        // Sender e-mail address.
        Msg.From = fromMail;
        // Recipient e-mail address.
        Msg.To.Add(new MailAddress("myemail@server.com"));
        // Subject of e-mail
        Msg.Subject = "متجر فلور ماركت";
        Msg.Body = " \n الاسم:\n " + txtNameAr.Text + "\nرقم الجوال :\n" + txtmobileNo.Text + " \n :البلد\n " + txtAddressAr.Text + " \n :الحي\n " + txtNeighborhood.Text + " \n العنوان بالتفصيل:\n " + txtbuilding.Text;
        Msg.Body += txtNameAr.Text;
        Msg.Body += txtmobileNo.Text;
        Msg.Body += txtAddressAr.Text;
        Msg.Body += txtNeighborhood.Text;
        Msg.Body += txtbuilding.Text;
        Msg.BodyEncoding = System.Text.Encoding.GetEncoding("windows-1256");
        Msg.Body += GetGridviewData(GridView1);
        //Msg.Body += GridView1.EmptyDataText;
        Msg.Body += "تم طلب التالي :  <br/><br/>";
        Msg.Priority = System.Net.Mail.MailPriority.High;
        SmtpClient a = new SmtpClient("relay-hosting.secureserver.net", 25);

        a.EnableSsl = false;
        a.DeliveryMethod = SmtpDeliveryMethod.Network;
        a.UseDefaultCredentials = false;
        a.Credentials = new System.Net.NetworkCredential("myemail@server.com", "pass");

        a.Send(Msg);


        ClearBoxs();
        Global.MessageBox("تمت عمليه الطلب بنجاح , شكرا لشرائكم من فلور ماركت", Page);
    }
<mailSettings>
  <smtp deliveryMethod="Network" from="myemail@server.com">
      <network host="relay-hosting.secureserver.net" userName="imyemail@server.com" password="pass" enableSsl="false"  defaultCredentials="false" />  
  </smtp>
</mailSettings>

0 个答案:

没有答案