How send email

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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/?_...ogview&_c=blogpart&partqs=amonth=2&ayear=2006
(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 said:
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.
 

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

Similar Threads


Back
Top