473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

SMTP Host

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

Dec 19 '07 #1
6 4513

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:u5**************@TK2MSFTNGP06.phx.gbl...
>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
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



Dec 19 '07 #2
"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:u5**************@TK2MSFTNGP06.phx.gbl...
>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...
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

Dec 19 '07 #3
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:
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

Dec 19 '07 #4
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:
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

Dec 19 '07 #5


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/blog/cns!A68482B9628A842A!138.entry
The code is downloadable. And if you setup a free gmail account, you can
even experiment with that.

"Jonathan Wood" <jw***@softcircuits.comwrote in message
news:u5**************@TK2MSFTNGP06.phx.gbl...
>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

Dec 19 '07 #6

"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote in
message news:%2****************@TK2MSFTNGP06.phx.gbl...
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 ....

Dec 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dan Boyle | last post by:
Hi, I am having difficulty connection to an smtp host. I am using the following code but I don't think I fully understand what smtp host can be used. function setSMTPParams($host = null,...
21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
2
by: David | last post by:
Hi Group, I'm having a few problems with getting an SMTP server configured on my Windows 2000 Server web server. My web server is co-located at my hosts and i use VNC to remotely access the web...
15
by: Steven Burn | last post by:
My server has POP but only has SMTP if sending to my domain, and not other domains (such as hotmail). I'm therefore wondering, if anyone knows of any scripts etc, that will allow me to have a sort...
6
by: John Salerno | last post by:
If I want to write a cgi script that reads the contents of an HTML form and emails it to me, what would I use as the host parameter for my SMTP instance? The example in the docs is 'localhost', but...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
2
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I've tried: MailSettingsSectionGroup mailConfig = WebConfigurationManager.GetSection("system.net/mailSettings") as MailSettingsSectionGroup; and: Configuration configurationFile =...
7
by: Rob Dob | last post by:
The following code is giving me a timeout problem., no matter what I do I can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port 465 and using ssl, if however I try using...
3
by: mturner64 | last post by:
I'm working on a simple web app to send email. Below is my code: Imports System.Net.Mail Partial Class _Default Inherits System.Web.UI.Page Protected Sub SubmitButton_Click(ByVal...
4
by: Kapil Choubisa | last post by:
Hello all I am using smtp for sending mail. it ask the smtp host name. that is smtp.Host = "smtp.gmail.com"; what is for yahoo/rediff/hotmail is there any one for globle mail systems.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.