|
Hi Pls find code mentioned below
Imports System.Net.Mail
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'create the mail message
Dim mail As New MailMessage()
Try
'set the addresses
'to specify a friendly 'from' name, we use a different ctor
mail.From = New MailAddress(TextBox1.Text)
mail.To.Add(TextBox2.Text)
'set the content
mail.Subject = "This is an email"
mail.Body = TextBox3.Text
'send the message
Dim smtp As New SmtpClient("127.0.0.1")
smtp.Send(mail)
Catch ex As Exception
Label1.Text = ex.ToString
End Try
End Sub
End Class
(Dot net 2.0)
If still you are unable to send mail using above code. Go to SMTP Virtual server properties --> Access and in connection and Relay specify your server
Don't Quit
|
|
|
|
|
Hi,
This applies if you are using the System.Net.Mail. When ever you send mail using the classes in above namespace, if an error occurs, an exception is thrown. If you dont get an exception from your code, that means you have successfully handed over the mail to the mail server.
By this i dont mean that the recipients of the mail, did recieved the mail. When you handed over the mail to the server, the server is now responsible for sending the mail further to the recepients mail server. There can be delay or even loss of mail during this process, according to the load on your mail server.
If you want to know whether the recepients have opened your mail there are some other techniques which you can implement.
Hope i got your point ?
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi coolestCoder.First of all thanks for replying. I've some questions based on your comments.
1. Can we make sure the same in dot net 1.1?
2.
coolestCoder wrote: If you want to know whether the recepients have opened your mail there are some other techniques which you can implement.
How to implement it or pls provide from where i can get started.?
3. How do yahoo, Google mail providers send a reply regarding Bounced mails?
Regards
Don't Quit
|
|
|
|
|
Hi,
1) we can make sure the same in 1.1 also.
2) Here is a link to get you started for read receipts.
http://www.systemnetmail.com/faq/3.3.3.aspx[^]
3) I didnt got your point. If you want to say that google.com sends a mail that the recepients mail box was not there or some error like that, then it is simple to understand. If you consider a scenario that you are sending mail from your google a/c to some yahoo a/c. You have already handed over your mail to google ( as explained in my previous post) Now the google server connects to yahoo server. It then tell the yahoo server that i have got mail for some xyz recepient on yahoo.com. If this is not available then yahoo just denies the mail or returns some error. Now, what the google server does is creates an email sepcifying details of errors and sends it back to you.
Hope i got you.
Also some other interesting techniques are available to know whether the recepients have opened your mails or not. In these techniques you embed an image ( invisible or some relevant one ) in your outgoing mails. When a request comes for this image on your server, you log the request. To identify specific recepients use some uniques code in the url for the image. These codes must be with you while sending mails. for more details search for it on google.com. Ya and you will have to write an HTTP module for logging requests.
Here is a link specifying what are HTTP Handlers and modules.
http://www.dotnetspider.com/qa/Question10117.aspx[^]
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Hi,
coolestCoder wrote: I didnt got your point. If you want to say that google.com sends a mail that the recepients mail box was not there or some error like that, then it is simple to understand. If you consider a scenario that you are sending mail from your google a/c to some yahoo a/c. You have already handed over your mail to google ( as explained in my previous post)
I mean to say if I want to provide functionality which Google provides for example if I've my own server relaying email messages and suppose user uses some id which is not existent on Google.com then how to show appropriate error message returned by Google.com to the user who has sent the mail.I hope now you can get my point clearly.
Thanks
Don't Quit
|
|
|
|
|
Hi,
there is some disscussion here -
http://www.mailsbroadcast.com/email.bolts.nuts/maintain.email.list.htm[^]
Nitin1981 wrote: how to show appropriate error message returned
I am not sure, but what you are looking for should be a setting in the Mail server.
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
hi all
I want to assign style to all my button controls without creating style class in style sheet. I mean that i dont want to assign any css class after creating my control. rather i want create tag such that when i create button control then that tag style will automatically assign to that control... So that i dont need to assign css class to all my control one by one.
Please help me
Regards,
DJ Rock
|
|
|
|
|
Hi,
Your question is not clear, however acc. to how I understood you can go for usercontrols or custom controls
cheers,
Akhilesh Yadav
|
|
|
|
|
thanks for reply
Ok first i want to make my question cleare. suppose i am creating button control ok?? and without creating any class i want to assign some style to my all button control that i am creating in my app. so want to create something like
H1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 2em;
font-weight: 700;
font-style: normal;
text-decoration: none;
word-spacing: normal;
letter-spacing: normal;
text-transform: none;
}
it will work for H1 tag. so i want to write code so that i can make it work for button and all asp controls.
thanks again
Regards,
DJ Rock
|
|
|
|
|
Hi,
I have a products page. There is a category group dropdown, and a category dropdown. When a category group is selected, all related categories are loaded. Then a category is selected. Then to browse all the products in the category, you have to click on a submit button. A gridview is populated with these products.
There is paging. So it loads 15 records, with a 1 and 2 respresenting the page numbers. So when I click on the 2 to see the next set of products I get the following error:
The GridView 'gvProducts' fired event PageIndexChanging which wasn't handled.
I'm not sure what this means. Can someone please help me. If you want to see it live, please go to http://www.jdship.com/products/browse.aspx. Select Protective and Safety Wear as the category group, and Boots as the category. Click on the Browse button. Try paging.
Please can someone help.
Regards
ma se
|
|
|
|
|
I guess you are binding the gridview to a list object? You cannot page a list object "list(of object)".
You need to bind the gridview to a datatable to enable paging on records.
Bind the grid to something like a objectdatasource that references code behind:
vb code:
<br />
Public Shared Function GetAllLocations() As DataTable<br />
<br />
Dim objLocation As Location = Nothing<br />
Dim objLocationResults As DataTable = New DataTable<br />
<br />
Dim objConn As New SqlConnection(GlobalSettings.ConnectionString)<br />
<br />
Try<br />
<br />
Dim objCommand As New SqlCommand("sp__GetAllLocations", objConn)<br />
objCommand.CommandType = CommandType.StoredProcedure<br />
<br />
Dim dtAdaptor As SqlDataAdapter = New SqlDataAdapter(objCommand)<br />
dtAdaptor.Fill(objLocationResults)<br />
<br />
<br />
Catch ex As Exception<br />
Dim strExceptionMsg As String = "Error Executing GetAllLocations(): " & vbCrLf & ex.Message & vbCrLf & ex.Source.ToString & vbCrLf & ex.StackTrace.ToString & vbCrLf<br />
<br />
Dim strSubject As String = "Error Executing GetAllLocations()"<br />
<br />
Throw New Exception(strExceptionMsg, ex)<br />
End If<br />
<br />
Finally<br />
<br />
End Try<br />
<br />
Return objLocationResults<br />
<br />
End Function
|
|
|
|
|
how i can retain the password from a asp text box when the page is post back
|
|
|
|
|
Before the post back, set the ‘value’ attribute of the text box.
TextBox1.Attributes.Add("value", TextBox1.Text)
Thomas
|
|
|
|
|
Thanks yaar... i am starter to this asp, so lots of doubts..
|
|
|
|
|
Hai there...
I got the solution for filling values in dropdownlist boxes by using AJAX in ASP.NET 2003, but i can't able to convert that codebehind aspx page into inline aspx page, because while i uploading that codebehind aspx into server means, it's not working. That's y i converted into inline coding. Please help me.
Regards
SAM.M
|
|
|
|
|
Hai there...
I got the solution for filling values in dropdownlist boxes by using AJAX in ASP.NET 2003, but i can't able to convert that codebehind aspx page into inline aspx page, because while i uploading that codebehind aspx into server means, it's not working. That's y i converted into inline coding. Please help me.
Regards
SAM.M
|
|
|
|
|
Hi Sam,
Don't Repost the Same Question.
Regards,
Satips.
|
|
|
|
|
suppose i have datagrid with 10 columns and i want to 3 column will be fixed and other can be scroll.so pls tell me how could i
have fixed column in a datagrid.pls help with sample code.
tbhattacharjee
|
|
|
|
|
Hi There,
Regarding all the details abt the datagrid Get the help from the below.
Get It[^]
Regards,
Satips.
|
|
|
|
|
|
suppose i am developing a webservice using dotnet version 1.1 and i want to know how a webservice method can return
a custom collection instead of dataset.from the client side i just bind the custom collection to any grid.pls help with sample code.
tbhattacharjee
|
|
|
|
|
Im trying to get the user's name when a page loads usign the code below, but im only getting an empty sting. could you please let me know why is this. and how can i fix it. thanks
dim userName as string = HttpContext.Current.User.Identity.Name.ToString()
|
|
|
|
|
pls find below conversation--
http://www.velocityreviews.com/forums/t67154-webhttpcontextcurrentuseridentityname-is-blank.html
Parwej Ahamad
|
|
|
|
|
If you are using 2.0 you can get the name off of request.loginidentity. Make sure you have nt authentication turned on.
|
|
|
|
|
How can I change the css of my buttons. The css will depend on the type of user, coz some of the buttons are not enable or using other css and some are enabled and using same css. i want to use mybtn.attributes.add( what code will i place here) and what will be aspx code, vb code, and class code etc. im using asp1 and vb.net .
Thanks
Jay
|
|
|
|