HighTechTalks DotNet Forums  

SMTP Host

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss SMTP Host in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jonathan Wood
 
Posts: n/a

Default SMTP Host - 12-19-2007 , 12:19 AM






I was curious what most people do when they want to send an email from their
Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do shared
servers typically have services available that can be used for this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


Reply With Quote
  #2  
Old   
Mohamad Elarabi
 
Posts: n/a

Default RE: SMTP Host - 12-19-2007 , 02:52 AM






You don't need a user name and password in most cases if you just want to
send an email. All you need is an IP address, and a port (usually 25) of a
mail server (SMTP service) that would allow you to relay through it.

Usually the Hosting company has that information, so your clients may not
even know it.

To give you an example, I could send emails through a mail server titled
mail.abc123.com, as zzUser (AT) abcxyz (DOT) com (a completely different domain). The
server you're sending from doesn't need to be related to the server you
recieve emails on. It just needs to allow you to send through it. That is
called Relaying emails, or allowing relay.

In code, you usually specify an IP address, and a port. Or a FQDN (i.e.
mail.yahoo.com) and a port. In some cases you would be required to pass a
username and password so you can relay through a certain server.

This doesn't exactly fit in this group but I'm assuming you don'y know what
info is needed to send emails in .Net.

--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.


"Jonathan Wood" wrote:

Quote:
I was curious what most people do when they want to send an email from their
Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do shared
servers typically have services available that can be used for this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Reply With Quote
  #3  
Old   
Barrie Wilson
 
Posts: n/a

Default Re: SMTP Host - 12-19-2007 , 03:01 AM




"Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote


Quote:
I was curious what most people do when they want to send an email from
their Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do
shared servers typically have services available that can be used for
this?
the ones I've used have all had SMTP service available; I wouldn't use them
if they didn't

Quote:
I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.
I usually request their admin to set up an application email account with
its own uid/pwd; I really don't ever want to know any user passwords if I
don't have to; some organizations have **extremely** strict prohibitions on
"lending" passwords or using them if it's not yours









Reply With Quote
  #4  
Old   
Mark Rae [MVP]
 
Posts: n/a

Default Re: SMTP Host - 12-19-2007 , 03:04 AM



"Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote


Quote:
I was curious what most people do when they want to send an email from
their Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do
shared servers typically have services available that can be used for
this?
Your ISP should provide an STMP queue which you can relay through - if they
don't, then find a decent ISP...

E.g. www.hostinguk.net provide a mail server with an SMTP queue at
relay.hostinguk.net which can be used for this purpose:
http://www.support.hostinguk.net/mail/default.htm, but only from within
their internal network, which means no username and password are required...

Quote:
I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.
Shouldn't be necessary...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net



Reply With Quote
  #5  
Old   
Robert Silver
 
Posts: n/a

Default RE: SMTP Host - 12-19-2007 , 04:37 AM



Jonathan,

For what it's worth, this is the code that I use to send emails from my code
whilst it's hosted on a server in the US (I'm a UK developer):
string fromMailAddress = [This is passed into to my method];
string emailServer = "smptp.hostingname_goes_here.com";
string hostName = "relay.hostingname_goes_here.com";
string duplicateConfirmationEmail = [From_my_web.config_file]
int portNumber = [Email_port_from_hosting_company_goes_here];
// This can be zero, but sometimes 25

System.Net.Mail.MailAddress fromMail = new
System.Net.Mail.MailAddress(fromMailAddress);
System.Net.Mail.MailAddress toMail = new
System.Net.Mail.MailAddress(custEmailAddress);
System.Net.Mail.MailAddress bccMail = new
System.Net.Mail.MailAddress(duplicateConfirmationE mail);
System.Net.Mail.MailMessage msgDetails = new
System.Net.Mail.MailMessage(fromMail, toMail);
msgDetails.Subject = "Subject goes here;
msgDetails.Body = "Body text here";
msgDetails.IsBodyHtml = true; // With this set you can put
<br/> in the body text to get carriage returns etc.


System.Net.Mail.SmtpClient client = new
System.Net.Mail.SmtpClient(emailServer);
if (hostName != "")
{
// I can't send BCC emails whilst the code runs locally or on our internal
servers.
// So I check that the hostname and if set, I'll send the BCC.
msgDetails.Bcc.Add(bccMail);
client.Host = hostName;
}

if (portNumber != 0)
client.Port = portNumber;

client.Send(msgDetails);

Hope it helps.

Robert Silver


"Jonathan Wood" wrote:

Quote:
I was curious what most people do when they want to send an email from their
Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do shared
servers typically have services available that can be used for this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Reply With Quote
  #6  
Old   
Braulio Diez
 
Posts: n/a

Default RE: SMTP Host - 12-19-2007 , 05:35 AM



In some cases you will find that you can just send e-mails from the web
server, no need for authentication (the server it sleft it's autohorized to
rely on a given smtp server).

More often you have to use user and password, I would ask the client what's
the case. To check if server and user and password are valid without having
to code .net try:

http://msexchangeteam.com/archive/20...14/428324.aspx

For testing purposes you can rely on GMail to do some simple development
tests:

http://www.codeproject.com/KB/cs/Sen...ilAccount.aspx

More info about SMTP and .net

http://www.tipsdotnet.com/ArticleBlo...TP&PageIndex=0

Good luck
Braulio



/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------




"Jonathan Wood" wrote:

Quote:
I was curious what most people do when they want to send an email from their
Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do shared
servers typically have services available that can be used for this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com



Reply With Quote
  #7  
Old   
sloan
 
Posts: n/a

Default Re: SMTP Host - 12-19-2007 , 10:05 AM





They (the isp) should provide you with some smtp server and perhaps
credentials.

...


In my "introduction letter" I got from my hosting service, they provided me
the smtp server name.

If you want a quick and easy configuration answer to different smtp
servers...then go there:

http://sholliday.spaces.live.com/blo...842A!138.entry


The code is downloadable. And if you setup a free gmail account, you can
even experiment with that.





"Jonathan Wood" <jwood (AT) softcircuits (DOT) com> wrote

Quote:
I was curious what most people do when they want to send an email from
their Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do
shared servers typically have services available that can be used for
this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com




Reply With Quote
  #8  
Old   
Scott Roberts
 
Posts: n/a

Default Re: SMTP Host - 12-19-2007 , 10:16 AM



Using an unprotected "relay" server for sending mail is a great way to have
all of your emails deposited directly into the recipient's Junk Mail folder.


"Mohamad Elarabi" <MohamadElarabi (AT) discussions (DOT) microsoft.com> wrote in
message news:0E854961-D690-4D4B-A0A5-AC9F37BC92B3 (AT) microsoft (DOT) com...
Quote:
You don't need a user name and password in most cases if you just want to
send an email. All you need is an IP address, and a port (usually 25) of a
mail server (SMTP service) that would allow you to relay through it.

Usually the Hosting company has that information, so your clients may not
even know it.

To give you an example, I could send emails through a mail server titled
mail.abc123.com, as zzUser (AT) abcxyz (DOT) com (a completely different domain). The
server you're sending from doesn't need to be related to the server you
recieve emails on. It just needs to allow you to send through it. That is
called Relaying emails, or allowing relay.

In code, you usually specify an IP address, and a port. Or a FQDN (i.e.
mail.yahoo.com) and a port. In some cases you would be required to pass a
username and password so you can relay through a certain server.

This doesn't exactly fit in this group but I'm assuming you don'y know
what
info is needed to send emails in .Net.

--
Mohamad Elarabi
Lead Developer. MCTS, MCPD.


"Jonathan Wood" wrote:

I was curious what most people do when they want to send an email from
their
Web application, which is hosted on a shared server owned by another
company.

Do you simply specify the SMTP host of your own email account, or do
shared
servers typically have services available that can be used for this?

I'm creating an application for a client and am not sure if I should ask
them for their email account information, which I assume includes their
password, etc.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com




Reply With Quote
  #9  
Old   
Barrie Wilson
 
Posts: n/a

Default Re: SMTP Host - 12-19-2007 , 11:58 AM




"Scott Roberts" <sroberts (AT) no (DOT) spam.here-webworks-software.com> wrote in
message news:%23NhhkIlQIHA.4128 (AT) TK2MSFTNGP06 (DOT) phx.gbl...

Quote:
Using an unprotected "relay" server for sending mail is a great way to
have all of your emails deposited directly into the recipient's Junk Mail
folder.
people should also keep in mind that if you run your own mail server
operating on a dynamic IP some hosts will reject mail from it, even if it
doesn't relay promiscuously ... your address block is effectively
black-listed ....







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.