|
Hai all,
I want to send bulk mail in asp.net using C#...Front End:Asp.Net with C# and Back End:Sql Server.
Following code is used to sending from gmail only...how i send from yahoo,hotmail,rediffmail,etc...
MailMessage mm = new MailMessage();
mm.From =new MailAddress(FromTextBox.Text);
mm.To.Add(ToTextBox.Text);
if (FileUpload1.HasFile)
{
Attachment at = new Attachment(FileUpload1.PostedFile.FileName);
mm.Attachments.Add(at);
}
mm.Subject = SubjectTextBox.Text;
mm.Body = MessageTextBox.Text;
SmtpClient sc = new SmtpClient();
sc.Host ="smtp.gmail.com";
sc.Port = 587;
sc.EnableSsl = true;
sc.Credentials =new System.Net.NetworkCredential(FromTextBox.Text,PasswordTextBox.Text);
sc.Send(mm);
Response.Write("Mail Sended");
how to send bulkmail from gmail,yahoo,rediffmail,hotmail etc..
how to attached single and multiple files and images...
how to store sended mail with and without single and multiple attachments...
how to do these all...please any body send code...
thanks in advance...
|
|
|
|
|
I have not checked but I assume Gmail, Yahoo, Hotmail, etc. all will have limits in place to prevent the sending of bulk mail.
For Gmail see: Sending limits[^].
0100000101101110011001000111001011101001
|
|
|
|
|
Hi, my problem is to find Multiview inside Details view.
I try this method:
MultiView m = (MultiView)DetailsView1.FindControl("MultiView1");
But on debug m result= null.
MultiView ovviusly is in itemtemplate.
Can how find this control?
modified 8-Oct-11 7:34am.
|
|
|
|
|
Let me see the markups.
Help people,so poeple can help you.
|
|
|
|
|
I am referring following article on Codeproject:
AutoMapper[^]
I would like to compare following code with GUID. can guide me to write function for checking GUID if the key (GUID) dose not exists in destination table then it will return false else true.
public class VIPResolver : ValueResolver<bool, string>
{
protected override string ResolveCore(bool source)
{
return source ? "Y" : "N";
}
}
Any answer would be appreciated!
Thanks,
Imdadhusen
sunaSaRa Imdadhusen
+91 99095 44184
|
|
|
|
|
When working with C# asp.net 2010 web controls, I am wondering if there is a method for handling errors? Basically is there any special way of handling errros that can occur? If not, when a web control is being accessed, should I put the code within a try-catch block?
|
|
|
|
|
Try/Catch is the basic way. Just handle your exceptions and perhaps display a friendly message to the use while logging the details for administrators.
No comment
|
|
|
|
|
Hi,
In gridview i am trying to show a form view,where i need to show a gridview along with some label and textbox fields.
how to perform this.
here is my code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
namespace Bbt.Slg.MWL.SupplyChainFinance.UI.Pages
{
public partial class CRH : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
gvConfRec.DataSource = DefaultValue();
gvConfRec.DataBind();
}
}
public DataTable DefaultValue()
{
DataTable Dt = new DataTable();
Dt.Columns.Add("AVname", typeof(string));
Dt.Columns.Add("AVcust", typeof(string));
Dt.Columns.Add("AVinv35", typeof(string));
Dt.Columns.Add("Avyes", typeof(string));
Dt.Columns.Add("AVamnt", typeof(string));
Dt.Columns.Add("AVindt", typeof(string));
Dt.Columns.Add("AVdudt", typeof(string));
Dt.Columns.Add("AVfndy", typeof(string));
Dt.Columns.Add("AVnolib", typeof(string));
Dt.Columns.Add("avkey46", typeof(string));
for (int i = 0; i < 20; i++)
{
DataRow dr = Dt.NewRow();
dr["AVname"] = "Suyan ent" + i.ToString();
dr["AVcust"] = "SUYAN ENTERPRISE" + i.ToString();
dr["AVinv35"] = "46454454" + i.ToString();
dr["Avyes"] = "YES" + i.ToString();
dr["AVamnt"] = "$24,232" + i.ToString();
dr["AVindt"] = "4-SEP-2011 " + i.ToString();
dr["AVdudt"] = "11-OCT-2008" + i.ToString();
dr["AVfndy"] = "180" + i.ToString();
dr["AVnolib"] = "0.865" + i.ToString();
dr["avkey46"] = "4,344" + i.ToString();
Dt.Rows.Add(dr);
}
return Dt;
}
public DataTable ConfirmReceivable()
{
DataTable Dt = new DataTable();
Dt.Columns.Add("STR", typeof(string));
Dt.Columns.Add("INVC#", typeof(string));
Dt.Columns.Add("PO#", typeof(string));
Dt.Columns.Add("INVDATE", typeof(string));
Dt.Columns.Add("DUEDATE", typeof(string));
Dt.Columns.Add("GROSSAMOUNT", typeof(string));
Dt.Columns.Add("NETAMOUNT", typeof(string));
for (int i = 0; i < 5; i++)
{
DataRow dr = Dt.NewRow();
dr["STR"] = " " + i.ToString();
dr["INVC#"] = "10199813" + i.ToString();
dr["PO#"] = " " + i.ToString();
dr["INVDATE"] = "5-SEP-2011 " + i.ToString();
dr["DUEDATE"] = " 13-OCT-2012" + i.ToString();
dr["GROSSAMOUNT"] = " " + i.ToString();
dr["NETAMOUNT"] = "$5,200 " + i.ToString();
Dt.Rows.Add(dr);
}
return Dt;
}
protected void gvConfRec_RowCommand(object sender, GridViewCommandEventArgs e)
{
}
protected void gvConfRec_RowDataBound(object sender, GridViewRowEventArgs e)
{
}
}
}
<pre lang="HTML">
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CRH.aspx.cs" Inherits="Bbt.Slg.MWL.SupplyChainFinance.UI.Pages.CRH" MasterPageFile="~/MasterPages/BBTSLG_SupplyChainFinanceMaster.master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div style="padding-top:3px"></div>
<div style="padding: 0px 0px 0 px 5px;">
<div class="heading">
Funding Request</div>
</div>
<asp:Panel ID="PanelDetails" runat="server" BorderWidth="1" Width="100%" Height="100px"
BorderColor="#848284">
<table border="0">
<tr>
<td class="style5"><asp:Label ID="Label1" runat="server" Text="Supplier:" CssClass="heading"></asp:Label></td>
<td><asp:Label ID="lbl_Supplier" runat="server" ForeColor="#CC0000" >AMS DISTRIBUTING INC-0255</asp:Label></td>
</tr>
<tr>
<td class="style5">
</td>
<td>
<asp:Label ID="Label3" runat="server"
Text="* Note: Funding Requests can be submitted daily after 11:00 AM ET. If check boxes do not appear under 'Fund', transaction rates have not yet posted."
style="color: #FF0000"></asp:Label>
</td>
</tr>
<tr>
<td class="style5"> </td>
<td>
<asp:GridView ID="gvConfRec" runat="server" AutoGenerateColumns="False" CellPadding="2"
ForeColor="Black" GridLines="Vertical"
CssClass="labelClass" Width="900px" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" PageSize="10"
AllowPaging="true" onrowcommand="gvConfRec_RowCommand"
onrowdatabound="gvConfRec_RowDataBound" >
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:TemplateField HeaderText="Fund *">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<asp:CheckBox ID="chkFund" Runat="server" Width="20px" Height="20px"></asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="AVname" HeaderText="Buyer" >
<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:BoundField Visible="False" DataField="AVcust" HeaderText="Buyer#" DataFormatString="{0:#}"></asp:BoundField>
<asp:BoundField DataField="AVinv35" HeaderText="CR Number">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:HyperLinkField DataNavigateUrlFields="avkey46" DataNavigateUrlFormatString="CRdetail.aspx?jwkey46={0}"
DataTextField="Avyes" HeaderText="Detail"></asp:HyperLinkField>
<asp:CommandField ShowSelectButton="True" HeaderText="Detail" />
<asp:BoundField DataField="AVamnt" HeaderText="CR Amount" DataFormatString="{0:$###,###,###.00;($###,###,###.00-;'';}">
<HeaderStyle HorizontalAlign="Right"></HeaderStyle>
<ItemStyle HorizontalAlign="Right" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="AVindt" HeaderText="CR Date" DataFormatString="{0:##/##/##;'';}">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="AVdudt" HeaderText="Due Date" DataFormatString="{0:##/##/##;'';}">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="AVfndy" HeaderText="Est Fund Days" DataFormatString="{0:#}">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" Wrap="false"></ItemStyle>
</asp:BoundField>
<asp:BoundField Visible="False" DataField="AVnolib" HeaderText="NoLib"></asp:BoundField>
</Columns>
<FooterStyle BackColor="#CCCC99" />
<PagerStyle BackColor="#848684" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#848684" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<RowStyle BackColor="#efefef" />
</asp:GridView>
<br />
<div>
<asp:FormView ID="FormView1" runat="server" >
<ItemTemplate>
<asp:Panel ID="panel1" runat="server" BorderWidth="1" BorderColor="#848284">
<div style="padding: 10px 0px 0 px 50px;">
<div class="heading">
Detail View of Confirmed Receivable-
<asp:Label runat="server" ID="Label1" CssClass="heading1" ></asp:Label>
</div>
<table cellpadding="2" cellspacing="2" align="center" class="labelClass" width="100%">
<tr>
<td class="style2">
Supplier:
</td>
<td style="width:180px">
<asp:Label runat="server" ID="lblSupplier" CssClass="heading1" Text="ALL TRADE TOOL INC"></asp:Label>
</td>
<td class="style1">
Buyer:
</td>
<td class="style3">
<asp:Label runat="server" ID="lblBuyer" CssClass="heading1" Text="ADVANCE STORE INC-2333"></asp:Label>
</td>
<td class="style4">
E-mail Listing To:</td>
<td style="style4">
<asp:TextBox runat="server" ID="txt_Email"></asp:TextBox>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" /></td>
</tr>
</table>
</div>
</asp:Panel>
<asp:Panel ID="pnlDetails" runat="server" BorderWidth="0" Width="100%" Height="50px">
<table cellpadding="2" cellspacing="2" align="center" class="labelClass" width="100%">
<tr>
<td class="style2">
Gross Amount:
</td>
<td style="width:180px">
<asp:Label runat="server" ID="lbl_GrossAmount" CssClass="heading1" Text="" ></asp:Label>
</td>
<td class="style1">
Receive Date:
</td>
<td class="style3">
<asp:Label runat="server" ID="lbl_ReceiveDate" CssClass="heading1" Text="6-JAN-2010" ></asp:Label>
</td>
<td class="style2">
Total Adjustments:
</td>
<td style="width:180px">
<asp:Label runat="server" ID="lbl_TotalAdjustment" CssClass="heading1" Text="" ></asp:Label>
</td>
<td class="style1">
Net amount:
</td>
<td class="style3">
<asp:Label runat="server" ID="lbl_NetAmount" CssClass="heading1" Text="$4,50,000" ></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="PanelDetails" runat="server" BorderWidth="1" Width="100%" Height="295px"
BorderColor="#848284">
<div style="padding: 10px 0px 0 px 50px;">
<table cellpadding="2" cellspacing="2" align="left">
<tr>
<td>
</td>
<td style="width: 30px" valign="top">
<img src="../Images/print3.jpg" alt="" />
<asp:GridView ID="gvConfirmReceivable" runat="server" AllowPaging="true"
AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE"
BorderStyle="None" BorderWidth="1px" CellPadding="4" CssClass="labelClass"
ForeColor="Black" GridLines="Vertical" PageSize="10" ShowFooter="true"
Width="1024px" >
<Columns>
<asp:BoundField DataField="STR" HeaderText="STR" />
<asp:BoundField DataField="INVC#" HeaderText="INVC#" />
<asp:BoundField DataField="PO#" HeaderText="PO#" />
<asp:BoundField DataField="INVDATE" HeaderText="INV DATE" />
<asp:BoundField DataField="DUEDATE" HeaderText="DUE DATE" />
<asp:BoundField DataField="GROSSAMOUNT" HeaderText="GROSS AMOUNT" />
<asp:BoundField DataField="NETAMOUNT" HeaderText="NET AMOUNT" />
</Columns>
<FooterStyle BackColor="#CCCC99" />
<PagerStyle BackColor="#848684" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#848684" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<RowStyle BackColor="#efefef" />
</asp:GridView>
</td>
</tr>
</table>
</div>
</asp:Panel>
</ItemTemplate>
</asp:FormView>
</div>
</td>
</tr>
<tr valign="middle" >
<td class="style5">
</td>
<caption>
<tr>
<td valign="middle" class="style5">
<asp:Button ID="btn_ReqFunding" runat="server" Text="Request Funding" />
<%----%></td>
</tr>
</caption>
</tr>
</table>
</asp:Panel>
</asp:Content>
<asp:Content ID="Content2" runat="server"
contentplaceholderid="ContentPlaceHolderHead">
<link href="../Styles/StyleSheet.css" rel="Stylesheet" type="text/css" />
<style type="text/css">
.style1
{
width: 381px;
}
.style2
{
width: 244px;
}
.style3
{
width: 218px;
}
.style4
{
width: 185px;
}
.style5
{
width: 120px;
}
</style>
</asp:Content>
|
|
|
|
|
Hi,
I have created a report with Report Viewer control using Visual Studio 2008 under 3.5 frame work in the local mode. However, I am trying to publish this website for public to use on Windows 2003 server. I have installed published the website with Web.Config from my machine and then executed ReportViewer.exe on this server by double clicking on it. This Report Viewer.exe was downloaded from Microsoft Report Viewer Redistributable 2005. However, so I read an article in this that I need to copy exe file from C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\ReportViewer\ReportViewer.exe to the server. I did the same, but I do not see same directory path on the server. It does not have no subdirecties from BootStrapper\Packages\ReportViewer\ReportViewer.exe in the server. When I try to access the website, it still says "Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies". Although I executed ReportViewer.exe from c:\ on the server, I am not sure what else needed to do. It says that all the required files in C:Windows directory. But I am not positive on copying files and placing them anywhere.
I am wondering if my actions are not coherent enough to publish the website or not. Any help is greatly appreciated.
|
|
|
|
|
Hi
I faced the same problem many times but with visual studio 2005. I got it fixed everytime by formatting and installing everything.... Then everything worked well again.
Naina
Naina
|
|
|
|
|
Thank you for your answer. However, in my situation, I can't do that because it is a server used by many people! Appreciate your time, though!
|
|
|
|
|
I have copied all dlls from windows folders to my website bin folder, and it worked.
|
|
|
|
|
Nice that it had worked copying the dll's, but this solution of moving the dll's didnt work for me
Naina
|
|
|
|
|
Salam guys;
I am trying to write a tool that is supposed to romanize arabic text. Do you now where i can get an algorithm or any thing useful.
Help people,so poeple can help you.
|
|
|
|
|
I think the biggest problem is caused by the "vocals" which could also be consonants. Look at your name: it starts with a waf, doesn't it, and hence could also be transliterated to Wamairi or Umairi; likewise with the yod - Omayari or Omayiri could also be possible. You must find some rules for that, otherwise you can only use a "look-up table", i.e. a Dictionary<string, string=""> containing pairs of Arabic and romanized versions for every word.
And when it comes to other languages using the Arabic alphabet (e.g. Persian, Pashtu, Urdu, traditional Malay, Turkish before Atatürk), the situation becomes even more complex.
|
|
|
|
|
Sir;
You are right the hardest job is to determine what the word is (hence the data entry wouldnt enter the word with vocals, with addition to hamzah, maddah, and shaddah which may be emitted). And the reset will be easy.
by the way, you know much about arabic (where did you learn that?!!)
Help people,so poeple can help you.
|
|
|
|
|
Can't see why your question was downvoted, it seems a reasonable question, even if the answer is not forthcoming.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|
|
i think its because when i first come here i was an annoying person and i made some enemies.
they might not understand the question but they judge the question by what they feel about me.
this is what most people do
Help people,so poeple can help you.
|
|
|
|
|
I got your message. Though I don't mind people e-mailing via CP, it would be much better to leave a message as the link gets lost & I need to do a search.
First off, I can [mostly] read the script, but I can't understand what has been written unless it is very simple so, mod everything I say through this knowledge. You might want to look up "transcription" - this is the proper term for what you are trying to do (i.e. transcription from Arabic to English), there may be good algorithms to do this out there, google has one in the opposite direction.
I'd start by mapping various letters to their latin equivalent in a dictionary ا =>a ب=> b etc. The problems start when there is no direct Latin equivalent. Some have well-known tranlisterations(ع => a',غ => gh خ=> kh) but will not be pronounced properly by an English reader for the most part. The other immediate problem you have are the "doubled" up letters: ق/ك normally transliterate to k/q but the q isn't really hard enough and will be pronounced as k by Europeans. Worse are the parings س/ص د/ض and the various "th" and "h" sounds. When I studied I used capital letters to denote the heavier sounds, but this will look odd. If you don't capitalize the Arabic will be incorrect, I think using the capitals will be better. All of these are surmountable with some flexibility.
Your real problems start with vowels. the distinction between اع (a'a)and عا (aa') is pretty fine and is confused by the fact that both letters can be sounded aa/a/u/i depending on the diacritic marks. ئ andء confuse the issue further. Next up is ي which can be sounded y or ee (and is normally transliterated "i" as in habibi). I don't know how to work round this problem (and وو which can be woo as in dawoud or oo ) probably they can be worked out algorithmically from the preceding letters, with the ability to override from a dictionary for quirks (a similar issue arises from ة and its position in the sentence). The final thing is text without hamza, sukkun damma, kasra etc. Without these diacritics, the whole thing becomes a research project, for example موقف => mwqf (resulting in a WTF ) instead of muwaqaf.
My advice:
- Start with vowel/punctuated/diacritic marked text
- Find a standard and stick to it, wikipedia has a page about Romanisation from Arabic[^]. One readers are used to your standard it will become easier to them
- pick of the easy stuff in a character==>character dictionary
- Work on algorithms to figure out the harder stuff
This last point, the best way is to throw real text and get someone to read the results. If you want un-vowelled text you'll need some way to cope, I've heard of working it out from the three-letter root and grammatical position, but this is a complex problem (one of the academics at work specializes in this field). Finally, the results can't be perfect: your users will just need to be aware of this, in the Seven Pillars of Wisdom by TE Lawrence, he deliberately transcribes names differently in different places. In the preface he admits this is partly to upset the proof readers, but partly to make the point that it can't be perfectly Latinized.
|
|
|
|
|
Sir;
at first thanks for your message. about the e-mail I'm sorry, but there is no 'Replay' link under your message 'Please leave message after the tone' on your board[^].
Sir;
actually, I am done with the first three points, and I am working on the fourth one(the algorithm). It should take a partially marked arabic word and returns several possibilities of the fully marked version. But, my algorithm is still too slow and it comes with too many possibilities, Also I can't handle the prefixes added to nouns(like al-(noun), wa-(noun), bi-(noun), fa-(noun), lil-(noun), ..etc).
Do you know how i can fix these?
Help people,so poeple can help you.
|
|
|
|
|
I'm sorry but I can't help, it is beyond my capabilities. I attended a seminar about this topic and the same problem was highlighted: too many results for the same letter groups. The approach to solve the problem was heuristic, taking the context of the sentence and matching / restricting the results from that. There is a full research project between my university and a company who provide searches in Arabic (they don't translate, but the problem domain of getting the full word from the text is the same). One problem is the sheer processing power needed for this. IMO there are two possibilities for the heuristic analysis, a bayesian beleif network is probably a good option and the most obviously applicable.I also thought a neural network might also be trained to perform it should also get better the more it is used.
Sorry to be so negative, but this is a hard problem, interesting though!
|
|
|
|
|
Hi Sir;
Finally, I made the romanization tool. Actually, the problem wasn't the romanization process itself but the word to be romanized.
First my tool accepts a text from the user and parse it into a collection of arabic words and separates(strings with no arabic letters). Then each word would be checked against a dictionary in the database. If if doesn't exist, the words would passed through an algorithm to suggest a fully adjustment for them according to specific rules. And after displaying the results the user of my tool can edit the romanized text in a modal dialog by choosing the correct adjustment of each word and then the roomanized version will be changed accordingly.
Finally, on accepting the dialog the results will be saved to the dictionary in the database.
Help people,so poeple can help you.
|
|
|
|
|
14 Months between my reply and yours, I said it would be hard LOL!
I'm glad you got it working.
|
|
|
|
|
Actually, I Developed two versions of the tool; one for desktop and the other for web(as an extender). And I was stopped several times because the requirements were not clear. In addition, enhancing of the algorithm took 6 months.
between you and me, it was a long exciting journey and i learned alot from that.
Help people,so poeple can help you.
|
|
|
|
|
I want to add a Company field to my forms authentication so that when a user logs in I can determine what company he belongs to and constrain the records he or she sees accordingly. Can someone point me to a good tutorial for this? I have no problem writing the code for it, I just need something that will point me in the right direction with a minimum (I hope) amount of fuss.
Cheers, --EA
|
|
|
|
|