Hi, I have a requirement to send mails to multiple recipients in wrod format with datas retrieved from database(sql server) through mail merge using c#.net. Any one has worked with this..? Thanks, Prabha
R Prabha Devi
Posts
-
Mail Merge using C#.net -
Mail Merge in Word 2003 using c#.Net (Web Application)Hi, Any one has worked with mailmerge in word 2003 using c#.net? If so , can i get sample code or any links?.. The following code i used in my application which gives error
wrdDoc.MailMerge.MailFormat = Word.WdMailMergeMailFormat.wdMailFormatPlainText; wrdDoc.MailMerge.MainDocumentType = Word.WdMailMergeMainDocType.wdEMail; wrdDoc.MailMerge.MailAddressFieldName = ""; wrdDoc.MailMerge.Destination = Word.WdMailMergeDestination.wdSendToEmail; wrdDoc.MailMerge.Execute(ref oFalse);
-
Enabling/Disabling DropdownListRepeating the query again. Already u have posted the query and i gave u the javascript code. Please refer that,don't repeat the query...
-
Urgent convert from vb.net to c#Hi Try the below link for conversions..... http://www.carlosag.net/Tools/CodeTranslator/Default.aspx[^] Hope helps u :)
-
drop downHi, Before binding value to the dropdown write the below code,
ddlUsers.Items.Clear();
newListItem = new ListItem();
newListItem.Value = "----Select a user---";
newListItem.Text = "----Select a user----";
ddlUsers.Items.Add(newListItem);ddlUsers.DataSource = Membership.GetAllUsers
ddlUsers.DataBind()Hope this helps u .. :)
-
JavaScript in MasterPages [asp.net 2.0]Hi, Try below code,
Hope it works..:)
-
JavaScript in MasterPages [asp.net 2.0]Hi, Try below code,
Hope it works...:)
-
How to retain radio button check (Urgent)Hi, On Combobox selection the page is getting submitted so grid is binded again, check for the 'AutoPostBack' of the combobox if it is 'true' make it to 'false'. Hope this helps u..:)
-
how to get Server IP Address?Hi, Below Code gives you the computer name,
System.Environment.MachineName
Hope helps u...:)
-
how to do "Lucene- WildCard Search"Hi, Try this below link...I got while searching... It has some download version of code.. http://dev2dev.bea.com/pub/a/2004/08/lucene_search_wlp81.html[^] Hope helps u :)
-
To Change an Image into different formats?Hi, Below code for image resizing and saving in C#
System.Drawing.Image imgResize;
System.Drawing.Image tempImage;string strPath;
strPath = "c:/personal/test.jpg";
imgResize = System.Drawing.Image.FromFile(strPath);
//Below code reducing the image width and height to increase u can multiply with numerals
tempImage = new Bitmap(imgResize,imgResize.Width / 3, imgResize.Height / 3);string strFilePath = "newfolderpath/imagename.jpg";
tempImage.Save(strFilePath,ImageFormat.Jpeg);
Hope this helps u...:)
-
Enabled/Disabled dropdownlistHi, Below code solves your problem.
function newtest()
{
//check box checked
if(document.getElementById("CheckBox1").checked == true)
document.getElementById("DropDownList1").disabled = true;
else //check box uncheck
document.getElementById("DropDownList1").disabled = false;
}Add the below code inside checkbox tag..
OnClick="newtest()" 'removed' text has to be changed to 'onclick'
Hope this helps you...:)
-
MessageHi, Mail code using SMTP mail server, using System.Web.Mail; //Code to send mail MailMessage mail = new MailMessage(); mail.To = "SentPerson@yahoo.com"; mail.Subject = "New Mail Test"; mail.Body = "Test mail sent"; mail.BodyEncoding = Encoding.ASCII; mail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = "www.servername.com" //smtp server mail.From = "GetPerson@yahoo.co.in"; SmtpMail.Send(mail); Hope this help u...:)
-
How to make a alert box on Button clickHi, On click of the button call a javascript method in code behind, Below is
.aspx.cs page code:
For eg : Let server control button id be 'btnSave'btnSave.Attributes.Add("OnClick","javascript:return ValidateTextBox();");
.aspx page code :
function ValidateTextBox()
{
//for eg:let the textbox id be 'txtName'//First check whether the textbox exists
if(document.getElementById("txtName")!=null)
{
if(isEmptyCheck("txtName")==true)
{
alert("Text box value is empty,please enter value");
return false;
}
}
}//function to check whether text box value is empty or not
function isEmptyCheck(X)
{
if((document.forms[0].elements[X].value=="") || (document.forms[0].elements[X].value.substring(0,1) == ' '))
{
return true;
}
return false;
}//end of functionHope this helps you... :)
-
Alert BoxHi, On click of the button call a javascript method in code behind, Below is
.aspx.cs page code:
For eg : Let server control button id be 'btnSave'btnSave.Attributes.Add("OnClick","javascript:return ValidateTextBox();");
.
aspx page code :
function ValidateTextBox()
{
//for eg:let the textbox id be 'txtName'//First check whether the textbox exists if(document.getElementById("txtName")!=null) { if(isEmptyCheck("txtName")==true) { alert("Text box value is empty,please enter value"); return false; } }
}
//function to check whether text box value is empty or not
function isEmptyCheck(X)
{
if((document.forms[0].elements[X].value=="") || (document.forms[0].elements[X].value.substring(0,1) == ' '))
{
return true;
}
return false;
}//end of functionHope this helps you...:)
-
mail id validationHi, Below is the javascript code for E-Mail validation, //Check for Proper Email Id //For this function Email id has to be passed
function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1) { //alert("Please enter a valid E-mail id.") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) { //alert("Please enter a valid E-mail id.") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) { alert("Please enter a valid E-mail id.") return false } if (str.indexOf(at,(lat+1))!=-1) { alert("Please enter a valid E-mail id.") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) { alert("Please enter a valid E-mail id.") return false } if (str.indexOf(dot,(lat+2))==-1) { alert("Please enter a valid E-mail id.") return false } if (str.indexOf(" ")!=-1) { alert("Please enter a valid E-mail id.") return false } return true }
Note: For multiple email ids u can split the email ids and send one by one to check. Hope this will hepl u...:) -
File Uploading from the user?The earlier code will work to complete ur requirement Declare a control as server control by below code Now try..:) -- modified at 8:35 Tuesday 25th April, 2006
-
File Uploading from the user?Try the below code,It is working in .Net 1.1 //uploading files control System.Web.UI.HtmlControls.HtmlInputFile ctlImageInput; //Declarations string strFileName; string strFilePath; string strFolder; //u can use the unique user name for all the folders strFolder = AppDomain.CurrentDomain.BaseDirectory + "Images/username"; // Creating Directory if ((!(Directory.Exists(strFolder)))) { Directory.CreateDirectory(strFolder); } //Saving source file to destination if( ctlImageInput.Value !="") { strFileName = ctlImageInput.PostedFile.FileName; strFileName = Path.GetFileName(strFileName); strFilePath = strFolder + "/"+ strFileName; ctlImageInput.PostedFile.SaveAs(strFilePath); }