| Author |
Sending e-mail from a ASP form
|
|
| Greg Maxey 2007-08-26, 6:15 pm |
| I have a user feedback form on my website that sends the e-mail to my
mvps.org e-mail account. I use this code in the .ASP file:
'create the email and send it
Set myMail=CreateObject("CDO.Message")
Mymail.From= UserEmail
Mymail.To= "gmaxey@mvps.org" 'change to your email
Mymail.Subject= "Website Feedback from " & Username
MyBody = "Message Type: " & MessageType & vbCrLf & vbCrLf
MyBody = MyBody & "Subject: " & Subject & vbCrLf & vbCrLf
MyBody = MyBody & "Subject Other: " & SubjectOther & vbCrLf & vbCrLf
MyBody = MyBody & "Comments: " & Comments & vbCrLf & vbCrLf
MyBody = MyBody & "Username: " & Username & vbCrLf & vbCrLf
MyBody = MyBody & "UserEmail: " & UserEmail & vbCrLf & vbCrLf
MyBody = MyBody & "ContactRequested: " & ContactRequested & vbCrLf
myMail.TextBody= MyBody
'Configure the server
Const cdoSchema = "http://schemas.microsoft.com/cdo/configuration/"
Mymail.Configuration.Fields.Item(cdoSchema & "sendusing") = 2
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") = "mail.mvps.org"
'change to your server
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25
Mymail.Configuration.Fields.Update
I would like to start using my gmail account for this purpose. I changed
the following three lines as show but I get an error about a connection to
the server when I try to implement it.
Mymail.To= "gmaxey@XXXXXXXXXX"
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") =
"smtp.XXXXXXXXXX"
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 465
I got the values for smtp server and serverport from a web pages describing
how to set up OE to send and recieve gmail. I don't know the meaning of the
"sendusing" value.
Thanks.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
| |
|
| Leave
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") =
"mail.mvps.org"
and
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25
as in original. The form uses the mvps.org email server to send the
email.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.
http://www.rxs-enterprises.org/fp
FrontPage Support: http://www.frontpagemvps.com/
"Greg Maxey" <gmaxey@mvps.oSCARrOMEOgOLF> wrote in message
news:exIIqi#5HHA.1484@TK2MSFTNGP06.phx.gbl:
> I have a user feedback form on my website that sends the e-mail to my
> mvps.org e-mail account. I use this code in the .ASP file:
>
> 'create the email and send it
> Set myMail=CreateObject("CDO.Message")
>
> Mymail.From= UserEmail
> Mymail.To= "gmaxey@mvps.org" 'change to your email
> Mymail.Subject= "Website Feedback from " & Username
>
> MyBody = "Message Type: " & MessageType & vbCrLf & vbCrLf
> MyBody = MyBody & "Subject: " & Subject & vbCrLf & vbCrLf
> MyBody = MyBody & "Subject Other: " & SubjectOther & vbCrLf & vbCrLf
> MyBody = MyBody & "Comments: " & Comments & vbCrLf & vbCrLf
> MyBody = MyBody & "Username: " & Username & vbCrLf & vbCrLf
> MyBody = MyBody & "UserEmail: " & UserEmail & vbCrLf & vbCrLf
> MyBody = MyBody & "ContactRequested: " & ContactRequested & vbCrLf
> myMail.TextBody= MyBody
>
> 'Configure the server
>
> Const cdoSchema = "http://schemas.microsoft.com/cdo/configuration/"
> Mymail.Configuration.Fields.Item(cdoSchema & "sendusing") = 2
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") = "mail.mvps.org"
> 'change to your server
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25
> Mymail.Configuration.Fields.Update
>
> I would like to start using my gmail account for this purpose. I changed
> the following three lines as show but I get an error about a connection to
> the server when I try to implement it.
>
> Mymail.To= "gmaxey@XXXXXXXXXX"
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") =
> "smtp.XXXXXXXXXX"
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 465
>
> I got the values for smtp server and serverport from a web pages describing
> how to set up OE to send and recieve gmail. I don't know the meaning of the
> "sendusing" value.
>
> Thanks.
>
> --
> Greg Maxey/Word MVP
> See:
> http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
| |
| Greg Maxey 2007-08-26, 6:15 pm |
| Ron,
I had tried that previously. I just changed:
Mymail.To= "gmaxey@mvps.org"
to
MymailTo= "gmaxey@XXXXXXXXXX"
That causes this error:
error '8004020f'
/Response.asp, line 138
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Ronx wrote:[color=darkred]
> Leave
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") =
> "mail.mvps.org"
> and
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25
> as in original. The form uses the mvps.org email server to send the
> email.
>
| |
|
| The SMTP server at mvps.org may be set to not relay messages from forms
to other domains. This is a common set up for web hosts in their fight
against spam.
This means that you are restricted to sending mail to your mvps.org
account. You could ask mvps admin for advice on this.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.
http://www.rxs-enterprises.org/fp
FrontPage Support: http://www.frontpagemvps.com/
"Greg Maxey" <gmaxey@mvps.oSCARrOMEOgOLF> wrote in message
news:uhEj9GA6HHA.4584@TK2MSFTNGP03.phx.gbl:
[color=darkred]
> Ron,
>
> I had tried that previously. I just changed:
> Mymail.To= "gmaxey@mvps.org"
> to
> MymailTo= "gmaxey@XXXXXXXXXX"
>
> That causes this error:
>
> error '8004020f'
> /Response.asp, line 138
>
>
>
> --
> Greg Maxey/Word MVP
> See:
> http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
>
>
> Ronx wrote:
| |
| Greg Maxey 2007-08-26, 6:15 pm |
| Ron,
Thanks.
I am not sure I understand fully. Is it because my website is posted on the
mvps.org server that I have to use:
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") = "mail.mvps.org"
and
Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25 ?
My real goal is not to have my personal e-mail address visible on my web
page. Suggestions?
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Ronx wrote:[color=darkred]
> The SMTP server at mvps.org may be set to not relay messages from
> forms to other domains. This is a common set up for web hosts in
> their fight against spam.
> This means that you are restricted to sending mail to your mvps.org
> account. You could ask mvps admin for advice on this.
>
| |
|
| The email address will not be visible in the page users see - the asp
code is translated by the server, some of it becomes HTML that will be
visible, some is never visible. You have to use the mvps SMTP servers
since that is where your website is located.
I use the same (or similar) coding at
http://www.rxs-enterprises.org/feedback/ You can hunt for an email
address on that page and won't find one.
--
Ron Symonds - Microsoft MVP (FrontPage)
Reply only to group - emails will be deleted unread.
http://www.rxs-enterprises.org/fp
FrontPage Support: http://www.frontpagemvps.com/
"Greg Maxey" <gmaxey@mvps.oSCARrOMEOgOLF> wrote in message
news:OvP42YB6HHA.5980@TK2MSFTNGP04.phx.gbl:
[color=darkred]
> Ron,
>
> Thanks.
>
> I am not sure I understand fully. Is it because my website is posted on the
> mvps.org server that I have to use:
>
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserver") = "mail.mvps.org"
>
> and
>
> Mymail.Configuration.Fields.Item(cdoSchema & "smtpserverport") = 25 ?
>
>
> My real goal is not to have my personal e-mail address visible on my web
> page. Suggestions?
>
>
> --
> Greg Maxey/Word MVP
> See:
> http://gregmaxey.mvps.org/word_tips.htm
> For some helpful tips using Word.
>
>
> Ronx wrote:
| |
| Greg Maxey 2007-08-27, 6:16 pm |
| Ron,
Thanks for your explanation and help.
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
"Ronx" <ronx917@hotmail.com> wrote in message
news:%23B9vxUI6HHA.5160@TK2MSFTNGP05.phx.gbl...
> The email address will not be visible in the page users see - the asp code
> is translated by the server, some of it becomes HTML that will be visible,
> some is never visible. You have to use the mvps SMTP servers since that
> is where your website is located.
> I use the same (or similar) coding at
> http://www.rxs-enterprises.org/feedback/ You can hunt for an email
> address on that page and won't find one.
> --
> Ron Symonds - Microsoft MVP (FrontPage)
> Reply only to group - emails will be deleted unread.
>
> http://www.rxs-enterprises.org/fp
>
> FrontPage Support: http://www.frontpagemvps.com/
>
>
>
>
> "Greg Maxey" <gmaxey@mvps.oSCARrOMEOgOLF> wrote in message
> news:OvP42YB6HHA.5980@TK2MSFTNGP04.phx.gbl:
>
>
|
|
|
|
| Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |