|
The page not more exist already. However 10s very much.
|
|
|
|
|
This is my code to send an email! but it didnt work
private void SendMail(string from, string body)
{
string mailservername = "mail.myURL.com";
string subject = "Contact Us FeedBack";
MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
SmtpClient mailclient = new SmtpClient();
mailclient.Host = mailservername;
mailclient.Send(message);
message.Dispose();
}
and I manipulate ASP.NET Configuraton. and change SMTP Server name to : "mail.myURL.com"
Any Idea?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
pampam110 wrote: but it didnt work
What do you mean by didn't work? Are you getting any error ? If yes, then what ?
pampam110 wrote: string mailservername = "mail.myURL.com";
pampam110 wrote: mailclient.Host = mailservername;
Does you SMTP server configure properly ?
|
|
|
|
|
Abhijit Jana wrote: What do you mean by didn't work? Are you getting any error ? If yes, then what ?
No Error. I mean This Code didnt send any email
Abhijit Jana wrote: Does you SMTP server configure properly ?
How Can i Configure it? I talk to where i buy Host and Domain, But they didnt help me.
[]D @ []v[] []D @ []v[]
|
|
|
|
|
If you are using SMTP Server of any web hosting site, I guess they can only help you to do it. Or Read some manual for that hosting site.
pampam110 wrote: I talk to where i buy Host and Domain, But they didnt help me
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thanks for your help!
I Check My Mail Box at http://mail.myURL.com/
"mail.myURL.com" is it my SMTP Server ? and another question is how can find my SMTP Server except Read Manual for this hosting site?
[]D @ []v[] []D @ []v[]
|
|
|
|
|
Try to find out with Provider if there mails are persisting in mail queue or not. OR is there any exception are raising in your application.
|
|
|
|
|
you need to contact u r host and ask them about email settings.
u can try to set SmtpServer property to '127.0.0.1'
|
|
|
|
|
my website is : www.mowjelectric.com
and my smtp is : mail.mowjelectric.com!
private void SendMail(string from, string body)
{
string mailservername = "mail.mowjelectric.com";
string subject = "Contact Us FeedBack";
MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
SmtpClient mailclient = new SmtpClient();
mailclient.Host = mailservername;
mailclient.Send(message);
message.Dispose();
}
Can u take a look in my code? Thanks!
[]D @ []v[] []D @ []v[]
|
|
|
|
|
Does your mail server requires authentication .. .
If so then login using authentication before sending mails.
|
|
|
|
|
Hi
I am able tp uplaod the files into the directory that i specified.
But the thing is when i upload the file, i want the information of the file ( file size, time of upload, file name etc) to be auto updated into the database.
please help!!
|
|
|
|
|
daffy_2003 wrote: But the thing is when i upload the file, i want the information of the file ( file size, time of upload, file name etc) to be auto updated into the database
When you are uoloading the file, you can easily do that. From PostedFile, you can get the FileName and FileSize . and when you are stroing it to database, just add a timestamp.
Like,
string strFileName=string.empty;
string strError=string.empty;
int FileLenght=0;
if (FileUpLoad1.HasFile)
{
FileUpLoad1.SaveAs(DestinationDir + FileUpLoad1.FileName);
strFileName = FileUpLoad1.FileName ;
FileLenght = FileUpload1.PostedFile.ContentLength
SaveFileDataInDB(strFileName,FileLength, DateTime.Now)
}
else
{
strError = "Error...";
}
Note : This is C# Code. Hope you can do it in VB.NET Now
Hope this will help you
|
|
|
|
|
hi thanks for the fast reply! i will try it out!
|
|
|
|
|
Cool. Let me know if you have any further issue.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi there, i tried out and it does display the info in the grid view. however, when a new file is uploaded, the existing info in the gridview is being overwrite by the new one. Any idea how to not let it overwrite the previous data? thanks!
|
|
|
|
|
daffy_2003 wrote: however, when a new file is uploaded, the existing info in the gridview is being overwrite by the new one. Any idea how to not let it overwrite the previous data?
This is why, I guess you didnt check the IsPostback Property on Page_Load().
So when the Image is uploading, Page is getting postback and grid is binding with blank data.
Do something like this is Page_Load
if( ! Page.ISPostBack)
{
BindGrid();
}
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hey there, it doesn't work. And another problem is that i have to close the page and open again before the gridview update itself. what should i do?
|
|
|
|
|
I want to bind not all but one part of columns of a datasource to a gridview, but I do not know which function can be used?
for example, the following code is used to bind all columns of database "Departments" to gridview departmentsGrid.
departmentsGrid.DataSource = dataSet.Tables["Departments"].DefaultView;
departmentsGrid.DataBind();
Note that for the gridview, I have set "AutoGenerateColumns" as True.
therefore, I have to select all the columns to bind. perhaps, I can set "AutoGenerateColumns" as False and then bind the columns one by one?
or is there any better solution?
thank you!
|
|
|
|
|
You have to do it on RowDataBound Event of Gridview.
|
|
|
|
|
It is always better to specify columns on the designer and AutoGenerateColumns false. So that if the selection to departments changes the page becomes intact.
|
|
|
|
|
I want to bind the gridview to a datasource which contains one image field. I have the following questions:
1: I use SQL 2005, it seems to be there are one 'image' type and one 'varbinary(max)', which one should be used?
2: in order to bind the imagefield to the gridview, i have to add one imagefield in the gridview, because gridview can not automatically to bind it.
but I use the following code, the image can not be displayed, instead of a red cross:
<asp:ImageField HeaderText="image" NullDisplayText="no"
NullImageUrl="~/Images/book_closed.gif" DataImageURLField="ImageTest">
</asp:ImageField>
<asp:sqldatasource id="DepartmentsSource"
selectcommand="Select [DepartmentID], [DepartmentID], [ImageTest],[Tel] From [Departments]"
connectionstring="Server=localhost\SqlExpress;Database=Dorknozzle;Integrated Security=True" providerName="System.Data.SqlClient"
runat="server"/>
anyone can give me one hint why?
thank you!
|
|
|
|
|
|
thanks, oh, right, your save image file just as the string path and it is GOOD.
|
|
|
|
|
Hello All,
I have designed menucontrol which renders dynamically by reading Xml file.
Here i am facing problem while applying differnt styles to menu item for static Menu
Please refer below diagram for Menu control, that i want to design programatically whose MenuItem text can be changed dynamically by changing Xml file.
Here i am not able to apply different style to menu item, I want "At School" & "At College" to be bold and "SclItem1 2 3" & "ClgItem1 2" to be in Normal font with some padding to its left programatically.
If you have any idea please post here or mail me on vikramkulkarni2007@gmail.com
Diagram
Education
--------------
At School -->Needs to be bold
SclItem1 -->Normal font
SclItem2
SclItem3
--------------
At College -->Needs to be bold
ClgItem1 -->Normal font
ClgItem2
--------------
Please do reply
Thanks,
Vikram
|
|
|
|
|