|
gmail, rediff account will need secured option (SSL is true). one more thing gmail server is some what slow. try after 10 mins of sending.
for attachement as copy & paste, u have send mail body as HTML.
for attachement code
<br />
MailMessage mail = new MailMessage();<br />
mail.From = txtFrom.Text;<br />
mail.To = txtTo.Text;<br />
mail.Subject = txtSubject.Text;<br />
mail.Body = txtMsg.Text;<br />
mail.BodyFormat = MailFormat.Html;<br />
<br />
'Change the path appropriately<br />
string strdir = "D:\\temp\\";<br />
string strfilename = <br />
Path.GetFileName(txtFile.PostedFile.FileName);<br />
txtFile.PostedFile.SaveAs(strdir+strfilename);<br />
mail.Attachments.Add(new MailAttachment(strdir+strfilename));<br />
<br />
try<br />
{<br />
SmtpMail.Send(mail); <br />
}<br />
catch(Exception ex)<br />
{<br />
Response.Write("Exception Occured: " +ex);<br />
}<br />
finally<br />
{<br />
Response.Write("Your E-mail has been sent sucessfully");<br />
}<br />
// Uploaded file deleted after sending e-mail<br />
File.Delete(strdir+strfilename);<br />
}<br />
Ramana
|
|
|
|
|
Hello Sir,
The code u sent me is great but i think u've sent this piece of code for attachment but i want to send the image as a background not as an attachment.........
And sir also the gmail and rediff not receiving mails.....
and SSL is also true.........
Plz suggest me something else and ver thnx for ur code
|
|
|
|
|
Hi All,
Can any one tell me what is the problem here? I am using ASP.NET 2005 and on menu click event I need to open page which is nothing but a div tab and it contains few combo and a textbox with ok and cancel button.
Everything works fine but I need a proper GUI as it contains Country, Select Sector, select sub industry and select company this should all come in proper way as show below:
Country combo
Select Sector combo
Select Sub Industry combo
Select Company combo
textbox
But it shows something like this:
Country combo
Select
Sector combo
Select Sub
Industry combo
Select
Company combo
textbox
I want left column in one line is Select Sector should in one line.
Please help me...
Following is the code:
<div id="p1" style="display: none; background-color:#FBFBFB ;border:1px solid Blue">
<table width="40%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="text" width="250px">
Country</td>
<td>
</td>
<td align="left">
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="ddlcountry"
Category="Country" PromptText="Select a Country" ServicePath="AutoComplete.asmx"
ServiceMethod="GetCountry" />
<asp:DropDownList ID="ddlcountry" CssClass="text" runat="server" Width="250px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="left" class="text">
Sector</td>
<td>
</td>
<td >
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="ddlSector"
ParentControlID="ddlcountry" Category="Sector" PromptText="Select a Sector" ServicePath="AutoComplete.asmx"
ServiceMethod="GetSector" />
<asp:DropDownList ID="ddlSector" runat="server" CssClass="text" Width="250px"> </asp:DropDownList> </td>
</tr>
<tr>
<td align="left" class="text">
Sub Industry
</td>
<td>
</td>
<td>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" TargetControlID="ddlSubIndustry"
ParentControlID="ddlSector" Category="Sector" PromptText="Select a SubIndustry"
ServicePath="AutoComplete.asmx" ServiceMethod="GetSubIndustry" />
<asp:DropDownList ID="ddlSubIndustry" runat="server" CssClass="text" Width="250px"> </asp:DropDownList></td>
</tr>
<tr>
<td align="left" class="text">
Company Name
</td>
<td>
</td>
<td>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown4" runat="server" TargetControlID="ddlCompany"
ParentControlID="ddlSubIndustry" Category="Company" PromptText="Select Company"
ServicePath="AutoComplete.asmx" ServiceMethod="GetTicker" />
<asp:DropDownList ID="ddlCompany" runat="server" CssClass="text" Width="250px"> </asp:DropDownList> </td>
</tr>
<tr>
<td align="left"> </td>
<td>
</td>
<td>
<asp:TextBox ID="myTextBox" runat="server" autocomplete="off"
CssClass="text" Height="14px" Width="249px">
</asp:TextBox>
<ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="myTextBox"
ServicePath="AutoComplete.asmx" ServiceMethod="GetCompletionList2" MinimumPrefixLength="0"
CompletionInterval="1000" CompletionSetCount="12" />
</td>
</tr>
<tr>
<td align="left">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td align="left">
</td>
<td></td>
<td align="right">
<input type="button" class="button" id="btnOk" onclick="myfunct1();" value="OK" />
<input type="button" id="btnCancel" class="button" value="Cancel" runat="server" onclick="myfunct();" />
</td>
</tr>
<tr>
<td align="left">
</td>
<td>
</td>
<td align="left">
</td>
</tr>
</table>
</div>
|
|
|
|
|
No Not again
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
What to do?? My problem is not yet solved... ![Frown | :(](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_frown.gif)
|
|
|
|
|
try to give border of the table 1 i.w border=1 for table in the div and check the widht of column then make adjustment
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi sandeep, sorry to say its still not working.... ![D'Oh! | :doh:](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_doh.gif)
|
|
|
|
|
Hey Sandeep its working now, I just gave width to div tag and made 100% width of table which is inside the div tag.. Thanks for ur help...
|
|
|
|
|
Thats what i was saying friday also as the width of the first column wsa not sufficent to have text in one line that's why it was wraping the text in next line ...
One more Suugestion is your application id browser compliant check it in Mozilla
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I facing this problem in Mozilla most of my control are getting overlapped. I dont know why???
|
|
|
|
|
Give the table border=1 then see how the table is formated
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Give 100% width to both div and table control and give 25% width to first TD and 75% width to second TD.
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
hi every body,
i want to pass one value from one page to another page can any body help me how tyo do this.
|
|
|
|
|
There are many ways to do it ...
but you can use Query string if those parameters are not threat to your application/user security
Response.Redirect("NextPage.aspx?FirstParam="+value1+"&SecondParameters="+value2);
Or check the google thats best way
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
yup this is want i am expecting!!!!!!!!
actually i forgotten the foramt.
thanx alot its working.
|
|
|
|
|
When you forget anything or want to know a new thing first you should search google after searching if you have any doubts then ask
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
You can use query string or session object.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Use Response.redirect to pass the value
Jintal Patel
|
|
|
|
|
Hi,
I need to Validator that not allow user to enter the PO box number in the Address field.
Thanks !
Hardik Panchal
|
|
|
|
|
Do you need to have that validator at client side or server side .
Write a custom validator for that ..... or
you can have javascript function to check the length of textbox ...
Why are you showing the PO box text box if you don't want that should be filled
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thanks,
I need it at client side.
I restrict to user to add po box in Address field.
I try different validation but it not work.
if u have then please give to me.
Hardik Panchal
|
|
|
|
|
Puting the javscript function that will validate the textbox but myfriend why are you showing that textbox to user ot make that textbox readonly do
function checkContent()
{
var txtbx=document.getElementById('TxtboxId');
if(txtbx.length>0)
{
alert('Dont write anything in Po textbox');
}
call this method in on button click event
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Thanks for ur reply.
But you not understand my problem.
I have one form in which user have to insert the shipping address.
I have condition, we not ship at PO box number.
There is a one text box where user have to insert their Address (street, Home number etc.)
Now i have to validate this text box to enter the po box number by user.
because some user may be enter po box number in address field.
Thanks
Hardik Panchal
|
|
|
|
|
Have got the solution for your validation
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi friend i am using javascript for enter key press but its work in internet explorer browser but its not work in mozilla firefox.how its work plz help me.
code:-
function enter(evt, buttonid)
{
var mykey, shift;
if (window.Event)
{
mykey = evt.which;
shift = (evt.modifiers & Event.SHIFT_MASK) ? true : false;
}
else
{
mykey = event.keyCode;
shift = event.shiftKey;
}
if(shift && mykey == 13)
{
return false;
}
else if(mykey == 13)
{
var btn = document.getElementById(buttonid);
if (btn != null)
{
btn.click();
setTimeout('messageDisplay()', 500);
flag=false;
event.keyCode = 0;
return false;
}
}
}
Piyush Vardhan Singh
Senior Software Engineer
TAS NewDelhi
India
|
|
|
|