ASP / Value Question

D

Dvan

Maybe there is an easy to do this. I am trying to send the results of a
form to our support mailbox. This works, but I have to provide it with a
static MailFrom.

I would like the From to be from the person who submitted the form.

Any insight? Our exchange server accepts a users Windows Logon, so I can
provide that and it should work.

I have a VBscript command that pulls that info plus the Doman into a string,
I can grab a substring of this to grab the UserID.

response.write "<input type=hidden name=User value='" & right(LogonUser,7) &
"'>"

Can I send this variable to this command somehow?
<input type=hidden name=mailfrom value=??????>

TIA
 
R

Ray Costanzo [MVP]

Try:

<%
sLogonuser = Request.ServerVariables("AUTH_USER")
sUsername = Split(sLogonuser & "\")(0)
sFrom = sUsername & "@yourdomainname.com"
%>

You don't have to put this value in a hidden input. If you do that, clever
people can spoof the from address. Instead, use the code above to generate
the From address for your mail object.

Ray at home
 
D

Dvan

Thanks "Ray at home", but the username plus "@yourdomainname.com"
will not work with my Exchange Server, it has to be either the Network ID
by itself or the format needs to be in (e-mail address removed)
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top