|
Thanks for the fast reply .
yes i configure the by default smtp which is the part of IIS correctly .
i checked into spam folder but there is nothing . nor in Inbox .
I have given the address 127.0.0.1
Best regards
Rameez
|
|
|
|
|
rameez Raja wrote: I have given the address 127.0.0.1
Are you talking about which address ? This is the loop Back Address .can you please put the line of code for mail sending section ?
Thanks in advance !!
|
|
|
|
|
Thanks Abhijit for reply ,
Here is the webconfig setting for my Page
<appSettings>
<add key="MyMailServer" value="localhost"/>
<add key="MyMailServerPort" value ="25"/>
</appSettings>
and here is send button click code
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click
'send message
Dim strMsg As String
strMsg = txtMessage.Text
mTo = Trim(txtTo.Text)
mFrom = Trim(txtFrom.Text)
mSubject = Trim(txtSubject.Text)
mMsg = Trim(txtMessage.Text)
mMailServer = ConfigurationManager.AppSettings.Get("MyMailServer")
mPort = ConfigurationManager.AppSettings.Get("MyMailServerPort")
mCC = Trim(txtCC.Text)
Try
Dim message As New MailMessage(mFrom, mTo, mSubject, mMsg)
If fileAttachments.HasFile Then
Dim attached As New Attachment(Trim(fileAttachments.PostedFile.FileName.ToString()))
message.Attachments.Add(attached)
End If
If mCC <> "" Or mCC <> String.Empty Then
Dim strCC() As String = Split(mCC, ";")
Dim strThisCC As String
For Each strThisCC In strCC
message.CC.Add(Trim(strThisCC))
Next
End If
Dim mySmtpClient As New SmtpClient(mMailServer, mPort)
mySmtpClient.UseDefaultCredentials = True
mySmtpClient.Send(message)
MessageBox("The mail message has been sent to " & message.To.ToString())
Catch ex As FormatException
MessageBox("Format Exception: " & ex.Message)
Catch ex As SmtpException
MessageBox("SMTP Exception: " & ex.Message)
Catch ex As Exception
MessageBox("General Exception: " & ex.Message)
End Try
End Sub
Best Regards
Rameez
|
|
|
|
|
"localhost" is most likely not an email server, you need to use the address of your mail server, such as mail.mycompany.com or 192.236.25.100
Also, if this is a web app, what are you using MessageBox for? Who is going to see the exception?
only two letters away from being an asset
|
|
|
|
|
I didn't get any thing wrong with your code for sending mail. I think there should have some problem with you SMTP Configuration.
|
|
|
|
|
Thanks for the reply,
it mean that i have to configure the smtp which is the part of IIS 6.0
can you guide me in configuration . any link or article point to this issue is highly appericated.
Best regards
Rameez
|
|
|
|
|
|
First of all I would like to say, you should get some knowledge about SMTP before going to implement Email functionality.
For your information... for testing purpose you can use gamil account for sending the mail see the below code-
MailMessage MyMailMessage=new MailMessage();
MyMailMessage.From = new MailAddress("g.parwez@gmail.com");
MyMailMessage.To.Add("g.parwez@gmail.com");
MyMailMessage.Subject = "Parwej Testing !!!";
MyMailMessage.Body = "This is the test text for Parwej Ahamad";
SmtpClient SMTPServer=new SmtpClient("smtp.gmail.com");
SMTPServer.Port = 587;
SMTPServer.Credentials =new System.Net.NetworkCredential("yourgmaid", "yourgmailpassword");
SMTPServer.EnableSsl = true;
SMTPServer.Send(MyMailMessage);
Parwej Ahamad
|
|
|
|
|
I am trying to deploy my ASP.NET 3.5 application to a server on my domain
And I have the following problems
1- I failed to deploy from my machine to the server remotely
I get the error "Could not find a Web server at 'servername'"
(Note that my machine runs WinXP and the server runs Vista with IIS7)
2-To test the server, I copied my work to the server and tried to deploy from there. It SUCCEEDED but still 2 problems:
2.i - the default page does not load, I have to write its path (so, how to define home page in IIS7)
2.ii - I failed to display the web site from any other machine in the domain
I hope to get ideas for all of the above
Thanks
|
|
|
|
|
Mohammed Gouda wrote: 1- I failed to deploy from my machine to the server remotely
I get the error "Could not find a Web server at 'servername'"
(Note that my machine runs WinXP and the server runs Vista with IIS7)
I didn't get your point. You want to deploy remotely ? are you using Copy web tool for that ?
Mohammed Gouda wrote: 2-To test the server, I copied my work to the server and tried to deploy from there. It SUCCEEDED but still 2 problems:
2.i - the default page does not load, I have to write its path (so, how to define home page in IIS7)
2.ii - I failed to display the web site from any other machine in the domain
Yaa.. few month back I have been working in production environment of on of my live project on IIS 7. There are a few changes in settings on IIS 7. I have written a complete article on that. Hope this will helps you
Deploying ASP. Net Websites on IIS 7.0 [^]
Here you get step by step guide . if you have any more doubts can ask me .
|
|
|
|
|
I've developed an application in .NET Framework 2 with c#. I'd like to build a good help file for my application. Since I'm beginer to this, I have no idea if there is a good solution for building a good help file or not.
THANKS,
|
|
|
|
|
There's no automatic way to do it, you need to build a help system yourself. The typical way to do it is to have a url such as help.aspx, and have a help icon that points to pages like help.aspx?id=24, where the id tells the page what help item to load out of the database.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
ravikumar.munde wrote: I'd like to build a good help file for my application
You can use just simple html page, or aspx page or even can use flash for that.
|
|
|
|
|
|
I'm trying to add a webusercontrol I've created dynamically through a page. I have the properties all set up correctly, and those are working. What happens when the Page_Load is that the labels that I have in the control are still null when the Page_Load runs, so a NullReferenceNotHandled exception is thrown when I try to access a label's Text property. What am I doing wrong?
Maybe I'm using the webusercontrol in the wrong way, I'm used to writing desktop applications...
He's the code I'm using, assume that I have the correct code for the properties
public NewsPost(string title, string date, string message, int newsId)
{
this.Title = title;
this.Date = date;
this.Message = message;
this.NewsId = newsId;
}
protected void Page_Load(object sender, EventArgs e)
{
lblTitle.Text = Title;
lblDate.Text = Date;
lblMessage.Text = Message;
}
|
|
|
|
|
Dynamically adding controls is always grief. A better way to do it is to build a collection of news item object and then bind them to a data driven control, in order to shoe them.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi all,
I want change a field in my database when a user leave whole of web application .
How i can underestand that a user leave Web Application then i change my data base.
I realy need your immediate help,
Thank You
Hoda
|
|
|
|
|
Saba02 wrote: I realy need your immediate help,
Of course you do. But, if you searched for this question, you'd find it's been asked many times before. There's no foolproof way to know, you can do some stuff with AJAX to try to make it foolproof, and that will work 99% of the time. If your app has users logging in, I'd just have a logout functionality, and a timeout so that if they don't log out, they get logged out after a reasonable amount of time. Otherwise, if you google, as I said, there's a client side event you can use to fire an ajax call telling you that they have left a page, then you can basically log them in and out, once for every page they visit.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The only way is to use the session and store handle your database when the session expires
But, I'd like to know what you need to store in database when the client exits
foreach(Minute m in MyLife)
myExperience++;
|
|
|
|
|
Mohammed Gouda wrote: The only way is to use the session and store handle your database when the session expires
That's not true, as I said, it's possible using AJAX to know when a client leaves a page, even if they do it by closing the browser.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Take a look at global.asa(x) or maybe you can solve this with some javascript. ex body onUnload
|
|
|
|
|
Hi All,
How to retrieve multiple eval values in textbox/textarea.I need to use "\r\n" along with multiple eval in textbox.Please help me.
Thanks,
kavitha.
|
|
|
|
|
I'm sorry, but I can't work out what you're asking. Best guess - use the Split method on the string class with Environment.NewLine to turn a multi line string into multiple strings.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
im not sure if this is what you are asking
But if you want to concatenate several columns
use something like this:
Text = '<%# String.format("{0}\r\n{1}") Eval("Col1").tostring, Eval("Col2").tostring %>'
You could concatenate the columns in the database as well
And you could explain better your question
Alexei Rodriguez
|
|
|
|
|
Hi all,
The following code snippet written in asp.I need to convert it as asp.net and language C#.I have to store the strPrevComplete into textbox.Please help.
strPrevComplete = vbcrlf & vbcrlf _
& "--------------------------" _
& vbcrlf _
& "Sent: " & strPrevDate _
& vbcrlf _
& "From: " & strPrevFrom _
& vbcrlf _
& "To: " & strPrevTo _
& vbcrlf _
& "Subject: " & strPrevSubject _
& vbcrlf & vbcrlf _
& strPrevBody
else
strPrevComplete = ""
end if
|
|
|
|