This topic is locked

Sending email to user with email field without using any email client

12/29/2006 4:52:09 AM
ASPRunnerPro General questions
H
HenriqueGuapo author

Hello,
I'm new in ASPRunner and I need some big HELP. I have a db with some fields, one of them is the "email6". This field is the client email and when I query the db one of the list fields that shows is among others - the email field. What I want is create some code that when we click in the email field that generate a message (subject and message predefined) to that user email and send this to the user email. The problem is that whith mailto: the email "calls" a email client (outlook, express, etc) and I want to send using a form (for example) or direct without calling a email client program.
Thanks in advance
(sorry my english)
Henrique Guapo

J
Jane 12/29/2006

Henrique,
you can do the following:

  1. proceed to the Visual Editor tab, set up Custom on the "View as" settings dialog and use following code:
    strValue = "<a href=""TableName_list.asp?sendmail=" & server.urlencode(strValue) & """>" & strValue & "</a>"

where TableName is your actual table name.
2. then use Request("sendmail") as email in the ListOnLoad event on the Events tab.

Here is a sample code:

Sub ListOnLoad()

'** Send simple email ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
email=Request("sendmail")

message="Hello there" & vbcrlf & "Best regards"

subject="Sample subject"

sendmail email, subject, message

End Sub

H
HenriqueGuapo author 12/29/2006

thanks Jane,
it's easy to put the code in place, but don't work. Give me an asp error:
[codebox]

Error number 3749

Error Fields update failed. For further information, examine the Status property of individual field objects.

URL /generali_pt/procuraAgentes/Agentp_list.asp

Consulta de SQL select [AGENTE], [NOMAGE], [DESDIS], [DESCON], [DOMICI], [ZONPOS], [ZONGIR], [ZONDES], [EMAIL6] From [Agentp] where (1=0 or ucase([Agentp].[NOMAGE]) like ucase('%LISBOA%') or ucase([Agentp].[DESDIS]) like ucase('%LISBOA%') or ucase([Agentp].[DESCON]) like ucase('%LISBOA%') or ucase([Agentp].[DOMICI]) like ucase('%LISBOA%') or ucase([Agentp].[ZONDES]) like ucase('%LISBOA%'))

[/codebox]
I have to configure the email parameters like From, SMTP server? Or configure some lines in commonfunctions.asp?
Please help!

H
HenriqueGuapo author 12/29/2006

thanks Jane,
it's easy to put the code in place, but don't work. Give me an asp error:
CODE

Error number 3749 Error Fields update failed. For further information, examine the Status property of individual field objects. URL /generali_pt/procuraAgentes/Agentp_list.asp Consulta de SQL select [AGENTE], [NOMAGE], [DESDIS], [DESCON], [DOMICI], [ZONPOS], [ZONGIR], [ZONDES], [EMAIL6] From [Agentp] where (1=0 or ucase([Agentp].[NOMAGE]) like ucase('%LISBOA%') or ucase([Agentp].[DESDIS]) like ucase('%LISBOA%') or ucase([Agentp].[DESCON]) like ucase('%LISBOA%') or ucase([Agentp].[DOMICI]) like ucase('%LISBOA%') or ucase([Agentp].[ZONDES]) like ucase('%LISBOA%'))
I have to configure the email parameters like From, SMTP server? Or configure some lines in commonfunctions.asp?
Please help!

J
Jane 12/29/2006

Henrique,
to congifure email parameters proceed to the Security tab, select Usename and password from database option, set up your email settings on the User login settings dialog and turn off login page.

H
HenriqueGuapo author 12/29/2006

Thanks but don't work.
the server give me the error: The transport failed to connect to the server.

and try to pass all the table.

Is that realy necessary?
Pleaaaaseeee help!
HG

H
HenriqueGuapo author 12/29/2006

Jane,
If you now, how can I pass the email string to another asp. page to use as a email form. When we make the query to the db click in the email link, open a new page with the parameter (email) fill the rest of the fields( message, from, etc) and send via sendmail.asp page to the email requested.
Thanks!
Henrique Guapo

Sergey Kornilov admin 12/29/2006

"The transport failed to connect to the server."
This error message means email setup is incorrect.

Either you don't have correct SMTP server address and port or firewall prevents email component from connecting to SMTP server.
If you need more help I need to see your project file and generated files. You may contact me directly at support@xlinesoft.com.