|
Hi,
Trying to send an email through asp.net 2.0
Here is the error message. Any ideas please?
Does this mean that the mail exchange server that I have provided is incorrect?
{"Unable to connect to the remote server"}
Here is what I am basically doing:
' Configure mail client (may need additional
' code for authenticated SMTP servers)
Dim mailClient As New SmtpClient(ncspConfiguration.MailServer)
' Create the mail message
Dim mailMessage As New MailMessage(from, [to], subject, body)
' Send mail
mailClient.Send(mailMessage)
|
|
|
|
|
Hi there,
fmardani wrote: Does this mean that the mail exchange server that I have provided is incorrect?
{"Unable to connect to the remote server"}
Not sure, but you can check this by sending email by email client (e.g: MS Outlook,...)
<< >>
|
|
|
|
|
If you mean being able to send email using outlook email then yes.
Thanks
|
|
|
|
|
For that, I just to make sure your mail server work fine
So the issue is from ur code, can u post ur snippet of code here? or you might try to debug your code to see which line cause the exception...
<< >>
|
|
|
|
|
The error is on this liine:
mailClient.Send(mailMessage)
The error message is in the very first post.
Thanks
|
|
|
|
|
just make sure again...
is the SMTP server correct or not? the work station you used to send email is able to connect to SMTP server or not?
<< >>
|
|
|
|
|
yes because I believe this is how I can send emails to the outside.
Thanks
|
|
|
|
|
To send an email
just check few things first:
go to
1.) start -> run and type inetmgr
It will open the IIS and expand the tree of the web server
2.)Right Click Default SMTP Virtial Server -> Properties -> and selcet Access Tab
3.) Click on Relay -> Select Add and type 127.0.0.1 and Select 'Only the List below' Radio Button
4.) Click OK
5.) Now Go to Start -> Control Panels -> Admin. Tools -> Services
6.) Restart SMTP Service
And then trying Sending Mial from your code.
I am not sure wheather this will work with ASP.NET 2.0 but it surely work otherwise making it sure that we write the following:
Smtp.SmtpServer="127.0.0.1"
SmtpMail.Send(mail)
where mail is the instance of Mail Class
Do tell whether this helps or not.
Hope this works.
All the best
Cheers
Enjoy!
|
|
|
|
|
Hi,
I carried out the all the six steps you mentioned.
But can not get .SmtpServer in the code ?
Thanks
|
|
|
|
|
Stopped the anti-virus on my machine.
Now the error I get is:
{"Mailbox unavailable. The server response was: 5.7.1 Unable to relay for jo.bloggs@data.org.uk"}
|
|
|
|
|
using Net.WebClient can able to send sms throw web service?
its working when use the code at asp.net, but @ web service it not working.
may i know the reason if any one knows?
thx
raj
raj
|
|
|
|
|
Standard Question #1:
What do you mean by "Not working"?
Also, a bit of English help:
"throw" should have been "through"
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
i am getting error called "The page cannot be displayed". not able to receive the sms as well.
raj
|
|
|
|
|
Fist, you have to make sure your webservice's supplier work???
you can contact to get support from them
<< >>
|
|
|
|
|
I found the bug, now working fine…
Thanks
raj
|
|
|
|
|
Hi,
There is a requirement to be able to upload files using a website (asp.net 2.0) . There should be a kind of validation on these files before the upload is allowed. What I am not sure of is how can I do any kind of validation on the files before the upload? For example if a file of type excel or .txt is to be uploaded, the website has to first check to see if there are certain data in the file... then if all ok the upload is allowed.
Thanks
|
|
|
|
|
You will have to uploda the file to the server first and do the checking there. If the checking fails simply delete the file.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I guess I can let the user know what the problem was?
Thanks
|
|
|
|
|
Why not?
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Well... you can use Javascript to at least check the file extension - this doesn't guarantee the file is valid, of course, but it will help eliminate some innocent errors....
If you have a file input box on your form
<input id="file1" type="file" onchange="checkFile(this)" name="file1">
You can use the following function - change the line
var fileTypes=["gif","jpg","jpeg"];
to suit whatever file extensions you want to check for.
function checkFile(what){
var source=what.value;
var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
// valid file types
var fileTypes=["gif","jpg","jpeg"];
for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
if (i==fileTypes.length) {
alert("THAT IS NOT A VALID FILE\nYou can only uload files with the following extensions:\n\n"+fileTypes.join(", "));
}
}
// -->
</script>
This script was adapted from one I downloaded from
The JavaScript Source!! http://javascript.internet.com
and the original was created by Abraham Joffe : http://www.abrahamjoffe.com.au/
They would probably appreciate your adding such comments to this script if you use it on a web-page.
cheers
Phil
-- modified at 4:26 Wednesday 26th April, 2006
|
|
|
|
|
Hi there,
Do you mean that you have to read the file's content to validate at client-side before uploading? if so, you upload file to server and validate at server-side. You dont have permission to read file at client
<< >>
|
|
|
|
|
|
|
For Print
1. window.print()
THis will print whole page
2. Give Link Print on click of which it will open IE popup using window.open()
which only contains grid control having same result and in that popup give print button on click of which it will print whatever there in the popup means as per our logic only grid with result.
You can hide print button using document.form.btnPrint.style.visiblity = hidden
OR
objBtn = document.getElementById(btnPrint)
objBtn.style.display = 'none'
|
|
|
|
|
hi
Ihave uninstall Microsoft IE WebControls and install ComponentArt still i didnt get any license key and performed a small program while compiling i get the following error
componentart_webui_client/2006_1_1208/A573G988.js not found
I am trying to search but in vain what exaclty this js file is .Can anyone who has worked with ComponentArt can explain me what went wrong.
When I can get the key I am using this coponent as trial basis .Please Guide me
thanks in advance
sasi
|
|
|
|