469,926 Members | 1,841 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

How send email

I am trying to write code to help me send an email. I have the email address
to sent to, stored in a database. I've read several articles and I'm not sure
what is meant by placing "yourmailserver" as a value. I plan to distribute
this program to several users. They could be using Yahoo, Hotmail, POP 3 or
SMTP. So I cannot hardcode the mailserver name. Is there some generic
mailserver? I have seen some use of localhost as mail server. Is this alright
to use?
--
L. A. Jones
Oct 5 '06 #1
3 1460

If you are at home, and have earthlink... then you can ~send an email to
anyone. But its has to go through ~your smtp server.
Which, if your dialed into earthlink, is probably something like
smtp.earthlink.net

You can download some code at:
http://sholliday.spaces.live.com/?_c...26ayear%3d2006
(Feb 2006)
Which shows a few different smtp server examples.

There is no generic mailserver. You have to change it, depending on where
youre at.

If your at home, then its probably something like smtp.earthlink.net
If you're at work, and your company names is www.peanutbuttermaker.com ,
then at work you'd have to make the
smtp server something like "smtp.peanutbuttermaker.com"

Anyway. You ~could get a google gmail account and use theirs.

But usually you store the servername in a config file. Check my blog for
code to make this very flexible and easy.

"Dave" <Da**@discussions.microsoft.comwrote in message
news:D2**********************************@microsof t.com...
I am trying to write code to help me send an email. I have the email
address
to sent to, stored in a database. I've read several articles and I'm not
sure
what is meant by placing "yourmailserver" as a value. I plan to distribute
this program to several users. They could be using Yahoo, Hotmail, POP 3
or
SMTP. So I cannot hardcode the mailserver name. Is there some generic
mailserver? I have seen some use of localhost as mail server. Is this
alright
to use?
--
L. A. Jones

Oct 5 '06 #2

"Dave" <Da**@discussions.microsoft.comwrote in message
news:D2**********************************@microsof t.com...
>I am trying to write code to help me send an email. I have the email
address
to sent to, stored in a database. I've read several articles and I'm not
sure
what is meant by placing "yourmailserver" as a value. I plan to distribute
this program to several users. They could be using Yahoo, Hotmail, POP 3
or
SMTP. So I cannot hardcode the mailserver name. Is there some generic
mailserver? I have seen some use of localhost as mail server. Is this
alright
to use?
Most "normal" users won't have their own mail server - so localhost will do
nothing.
They will need their own SMTP mail server. This is normally provided by the
isp (i.e. smtp.myisp.co.uk, or mail.ispco.com etc), and will allow sending
if connected to the ISP's node, however if they use the likes of hotmail and
so on it can be more complicated, because these often don't have an SMTP
"interface" (or you have to pay for it).
POP3 is generally for retrieving mail, not sending it, so skip that.

The other option is for you to register a domain for your product (making
sure that it supports sending mail thru SMTP) and hard-code the app to use
that... however this does open you up to a bit more of a security headache;
you'd need to ensure that the username and password used were sufficiently
complex to not allow people to do a "brute-force" crack on your mailserver
and subsequently use it for spamming, and also you might want to look at
only allowing access via SSL if whoever hosts the domain supports that.

James.
Oct 5 '06 #3
Have you try this?
http://msdn2.microsoft.com/en-us/lib....smtpmail.aspx

chanmm

"Dave" <Da**@discussions.microsoft.comwrote in message
news:D2**********************************@microsof t.com...
>I am trying to write code to help me send an email. I have the email
address
to sent to, stored in a database. I've read several articles and I'm not
sure
what is meant by placing "yourmailserver" as a value. I plan to distribute
this program to several users. They could be using Yahoo, Hotmail, POP 3
or
SMTP. So I cannot hardcode the mailserver name. Is there some generic
mailserver? I have seen some use of localhost as mail server. Is this
alright
to use?
--
L. A. Jones

Oct 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Google Mike | last post: by
40 posts views Thread by ian | last post: by
reply views Thread by David Burson | last post: by
9 posts views Thread by Bob Jones | last post: by
8 posts views Thread by shapper | last post: by
9 posts views Thread by Mahernoz | last post: by
2 posts views Thread by Malli mindwave | last post: by
5 posts views Thread by Mike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.