By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,190 Members | 857 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,190 IT Pros & Developers. It's quick & easy.

Sending mail without specifying the "From" field

P: n/a
I am writing a web application will will be hosted on a few peoples laptops
as a local application. It will send e-mails once the user connects to the
internet.

How can I set up the "Mail.From" field if I don't know the address of the
user's laptop? I have managed to get it working on my own machine, but
setting the "From" filed to "Localhost" doesn't seem to work.

Any suggestions?
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Well, the laptop doesn't have an email address. The user does, and neither
the laptop nor your application has any way of just knowing what it is.

You need to have some sort of configuration page in your app, where the user
has to provide his/her email address.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
I am writing a web application will will be hosted on a few peoples laptops
as a local application. It will send e-mails once the user connects to
the
internet.

How can I set up the "Mail.From" field if I don't know the address of the
user's laptop? I have managed to get it working on my own machine, but
setting the "From" filed to "Localhost" doesn't seem to work.

Any suggestions?

Nov 21 '05 #2

P: n/a
Marina,

would I be right in saying that I cannot have a generic name for the SMTP
server on the local computer, such as "Localhost"?

I have tried to send these automatic e-mails using my AOL account, but that
didn't work. I had to get a BT Internet account in order for this to work.
If any of the users have AOL, the application would be useless.

I need to find a way to be able to send the e-mails automatically regardless
of the ISP provider and preferably without having to ask for the user's
e-mails address.

If this is not possible, I will have to get the e-mail addresses in advance,
but I am hopeful of a solution...

"Marina" wrote:
Well, the laptop doesn't have an email address. The user does, and neither
the laptop nor your application has any way of just knowing what it is.

You need to have some sort of configuration page in your app, where the user
has to provide his/her email address.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
I am writing a web application will will be hosted on a few peoples laptops
as a local application. It will send e-mails once the user connects to
the
internet.

How can I set up the "Mail.From" field if I don't know the address of the
user's laptop? I have managed to get it working on my own machine, but
setting the "From" filed to "Localhost" doesn't seem to work.

Any suggestions?


Nov 21 '05 #3

P: n/a
You were asking about how to specify who the email is coming from. At least
that is what it sounded like to me - not the name of the server. These are 2
really different things.

You can always get the name of the current machine from
System.Environment.MachineName. If the user has SMTP enabled on the machine,
you can then send out emails using that as the server.

You can't magically get a real, valid email address, which you still need,
since you have to say who is sending it.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:CE**********************************@microsof t.com...
Marina,

would I be right in saying that I cannot have a generic name for the SMTP
server on the local computer, such as "Localhost"?

I have tried to send these automatic e-mails using my AOL account, but
that
didn't work. I had to get a BT Internet account in order for this to
work.
If any of the users have AOL, the application would be useless.

I need to find a way to be able to send the e-mails automatically
regardless
of the ISP provider and preferably without having to ask for the user's
e-mails address.

If this is not possible, I will have to get the e-mail addresses in
advance,
but I am hopeful of a solution...

"Marina" wrote:
Well, the laptop doesn't have an email address. The user does, and
neither
the laptop nor your application has any way of just knowing what it is.

You need to have some sort of configuration page in your app, where the
user
has to provide his/her email address.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
>I am writing a web application will will be hosted on a few peoples
>laptops
> as a local application. It will send e-mails once the user connects to
> the
> internet.
>
> How can I set up the "Mail.From" field if I don't know the address of
> the
> user's laptop? I have managed to get it working on my own machine, but
> setting the "From" filed to "Localhost" doesn't seem to work.
>
> Any suggestions?


Nov 21 '05 #4

P: n/a
Marina,

I have tried creating a string variable which is set to the value of
System.Environment.machinename, but this is still not working.

SMTP is definately working on my machine, but this has not solved the problem.

I would appreciate any other suggestions.

"Marina" wrote:
You were asking about how to specify who the email is coming from. At least
that is what it sounded like to me - not the name of the server. These are 2
really different things.

You can always get the name of the current machine from
System.Environment.MachineName. If the user has SMTP enabled on the machine,
you can then send out emails using that as the server.

You can't magically get a real, valid email address, which you still need,
since you have to say who is sending it.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:CE**********************************@microsof t.com...
Marina,

would I be right in saying that I cannot have a generic name for the SMTP
server on the local computer, such as "Localhost"?

I have tried to send these automatic e-mails using my AOL account, but
that
didn't work. I had to get a BT Internet account in order for this to
work.
If any of the users have AOL, the application would be useless.

I need to find a way to be able to send the e-mails automatically
regardless
of the ISP provider and preferably without having to ask for the user's
e-mails address.

If this is not possible, I will have to get the e-mail addresses in
advance,
but I am hopeful of a solution...

"Marina" wrote:
Well, the laptop doesn't have an email address. The user does, and
neither
the laptop nor your application has any way of just knowing what it is.

You need to have some sort of configuration page in your app, where the
user
has to provide his/her email address.

"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
>I am writing a web application will will be hosted on a few peoples
>laptops
> as a local application. It will send e-mails once the user connects to
> the
> internet.
>
> How can I set up the "Mail.From" field if I don't know the address of
> the
> user's laptop? I have managed to get it working on my own machine, but
> setting the "From" filed to "Localhost" doesn't seem to work.
>
> Any suggestions?


Nov 21 '05 #5

P: n/a
> How can I set up the "Mail.From" field if I don't know the address of the
user's laptop? I have managed to get it working on my own machine, but
setting the "From" filed to "Localhost" doesn't seem to work.


Assuming you are using
System.Web.Mail.SmtpMail.Send()
try setting the first parameter to Nothing/null. I haven't messed with it
for a while, but it worked for me on one occasion. The email went out from
the default email account on the machine running the program.

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.