sending mail without smptserver

  • Thread starter Thread starter Pascal Cloup
  • Start date Start date
P

Pascal Cloup

Hello,

I just want to send an e-mail from my windows form application without
specifying SmtpServer.

On my computer, when i specify my smtpserver, SmtpMail.Send( aMail ) works
fine, but without specifuing SmtpMail.SmtpServer, the message is never
sent.. I tried various things like SmtpMail.SmtpServer = "" or
SmtpMail.SmtpServer = "localhost" or
SmtpMail.SmtpServer.Insert"0,"localhost""), ... the result was the same

Someone know how to do that? or how to know the SmtpServer of the current
user?

thanks in advance,

Pascal
 
Trying to send email without an SMTP server is like trying to send a letter
without a Post Office.

an SMTP Server is a service that runs on a machine. The Server's location is
the IP address of the machine. It listens on TCP Port 25 of that machine.
"localhost" is a Host Name for the local machine, and is recognized as such
by most OS's today. It maps to IP address 127.0.0.1, the local loopback
address for the machine. Using "localhost" will work as long as the machine
on which the code resides has an SMTP Server.

Note: A "current user" has no SMTP server. Only a machine can. IIS comes
with an SMTP Server, which may or may not be installed on the server.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
thanks for your explanations Kevin,

but after verifying, my computer have IIs with smtp services installed. So
the problem is elsewher.
Never mind, as it will not be always the case for the computer of the users
of my applications, is there a way to obtain the smtp server?

thanks in advance,

Pascal
 
Hi Pascal,

You're still misunderstanding me. There is no SMTP server on the client
machine, any more than there is a Web Server. The SMTP Server is on the web
server, or another server having an SMTP server is used.

Your problem is probably due to the configuration of the SMTP server on your
server. If, for example, you are attempting to send an email in which the
"From" domain is not the same domain as the server's domain, and the server
doesn't allow relaying (most do not, as this is typically used by SPAMMERs),
the email will not be sent.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
ok, thanks for explanation (as you undertood, i'm not a web specialist),

So what must i do to allow the users of my software (on their computer) to
send me an e-mail from my application without have to provide their smtp
server name?

Thanks in advance,

Pascal
 
Hi all,

I found a solution.
the Smtp Server can retrieved from the registry under the Key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts

and with a subkey depending on the account that you are looking for.

Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top