Gossamer Forum
Home : Products : DBMan : Installation :

Send Record (no record received) Problem

Quote Reply
Send Record (no record received) Problem
Hi-

I finally got the send record routine to work, but the record never reaches the e-mail recipient. I receive a message stating the record has been sent successfully, but no e-mail arrives =(...what do you think might be the problem?

Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
Are you saying that the email is not received or that the record information is not contained within the email they receive?

Please be more specific as to what the problem is.

Also perhaps posting the snippet of code for the mailing portion will help to see if there is something that needs fixing.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Send Record (no record received) Problem In reply to
Sorry =) no e-mail is received...here's the code

###############################################################################
#file: html.pl #
# new subroutine #
# sub html_forward_email_form #
###############################################################################

sub html_forward_email_form {
#----------------------------------------------------------
my ($message) = $_[0];
$in{$db_key} =~ s/<?.B>//g;
%rec = &get_record($in{$db_key});

unless ($in{'email_message'}) {
foreach $col (@db_cols) {
$in{'email_message'} .= "$col: $rec{$col}\n";
}
}

&html_print_headers;

print qq|
<html><head><title>$html_title: Send an email</title></head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Send an email</b></td></tr>
<tr><td>
<p><center><$font_title><b>
Send an email
</b></font></center>

|;

if ($message) { print qq|There was a problem: $message|; }
print qq|
<$font>Fill in your email address, the subject of your email and the
message you wish to send to $rec{'Name'}.</font>
|;

print qq|
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$in{$db_key}">
<table><tr><td align=right><$font>Your email address:</font></td>
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
<tr><td align=right><$font>Recipient's email address:</font></td>
<td><input type=text name="to_email" value="$in{'to_email'}" size=40></td></tr>
<tr><td align=right><$font>Subject:</font></td>
<td><input type=text name="subject" value="$in{'subject'}" size=40></td></tr>
<tr><td align=right><$font>Your message:</font></td>
<td><textarea name="emailmessage" cols=40 rows=10 wrap="virtual">$in{'email_message'}</TEXTAREA></td></tr>
</table>
<center>
<INPUT TYPE="SUBMIT" NAME="forward_email" VALUE="Send Record">
<INPUT TYPE="RESET" VALUE="Reset Form">
</center>
</form>
|;

&html_footer;
print qq|</td></tr></table></body></html>|;
}

###############################################################################
#file: html.pl #
# new subroutine #
# sub html_forward_email_success #
###############################################################################

sub html_forward_email_success {
#-----------------------------------------------
&html_print_headers;

print qq|
<html><head><title>$html_title: Send an email</title></head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Send an email</b></td></tr>
<tr><td><p><center><$font_title><b>
Send an email
</b></font></center>

|;

print qq|<$font>Your email message was sent.</font><P>
<center>
<a href="$db_script_link_url&$db_key=$in{$db_key}&view_records=1">
<$font>Go back to the record</font></a></center>|;


&html_footer;
print qq|</td></tr></table></body></html>|;
}




Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
There was some corrections made to that mod which included changes the references of:

email_message

to:

emailmessage

Also be sure that you have defined in your .cfg file:

# the email address of the one who owns the record. Set to -1 if not used.
$db_email_field = 'Email';

and the path to your sendmail program set with the following variable: $mailprog

Also try using this at the top of your sub to send the email:

%rec=&get_record($in{$db_key});
&html_record(%rec);

or if using short/long mod use:

%rec=&get_record($in{$db_key});
&html_record_long(%rec);

Hope this gets it working for you.



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Send Record (no record received) Problem In reply to
Hi Lois..its still not working. what do you think could be the problem? it says the message has been sent, but i never recieve anything.

###############################################################################
#file: html.pl #
# new subroutine #
# sub html_forward_email_form #
###############################################################################

sub html_forward_email_form {
#----------------------------------------------------------


my ($message) = $_[0];
$in{$db_key} =~ s/<?.B>//g;
%rec = &get_record($in{$db_key});


unless ($in{'emailmessage'}) {
foreach $col (@db_cols) {
$in{'emailmessage'} .= "$col: $rec{$col}\n";
}
}

&html_print_headers;

print qq|
<html><head><title>$html_title: Send an email</title></head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Send an email</b></td></tr>
<tr><td>
<p><center><$font_title><b>
Send an email
</b></font></center>

|;

if ($message) { print qq|There was a problem: $message|; }
print qq|
<$font>Fill in your email address, the subject of your email and the
message you wish to send to $rec{'Name'}.</font>
|;

print qq|
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$in{$db_key}">
<table><tr><td align=right><$font>Your email address:</font></td>
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
<tr><td align=right><$font>Recipient's email address:</font></td>
<td><input type=text name="to_email" value="$in{'to_email'}" size=40></td></tr>
<tr><td align=right><$font>Subject:</font></td>
<td><input type=text name="subject" value="$in{'subject'}" size=40></td></tr>
<tr><td align=right><$font>Your message:</font></td>
<td><textarea name="emailmessage" cols=40 rows=10 wrap="virtual">$in{'emailmessage'}</TEXTAREA></td></tr>
</table>
<center>
<INPUT TYPE="SUBMIT" NAME="forward_email" VALUE="Send Record">
<INPUT TYPE="RESET" VALUE="Reset Form">
</center>
</form>
|;

&html_footer;
print qq|</td></tr></table></body></html>|;
}

###############################################################################
#file: html.pl #
# new subroutine #
# sub html_forward_email_success #
###############################################################################

sub html_forward_email_success {
#-----------------------------------------------
&html_print_headers;

print qq|
<html><head><title>$html_title: Send an email</title></head>
<body bgcolor="#DDDDDD">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=500 align=center valign=top>
<tr><td colspan=2 bgcolor="navy">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Send an email</b></td></tr>
<tr><td><p><center><$font_title><b>
Send an email
</b></font></center>

|;

print qq|<$font>Your email message was sent.</font><P>
<center>
<a href="$db_script_link_url&$db_key=$in{$db_key}&view_records=1">
<$font>Go back to the record</font></a></center>|;


&html_footer;
print qq|</td></tr></table></body></html>|;
}


# Authorization Options
# --------------------------------------------------------
# Full path to sendmail program

$mailprog = "/usr/lib/sendmail";

# the email address of the one who owns the record. Set to -1 if not used.
$db_email_field = -1;

# No Authentication? (1 = "there is no authentication", 0 = "there is authentication")
# If you choose no authentication, then set the permissions of what
# people can do with: @auth_default_permissions below.
$auth_no_authentication = 0;

# The amount of time in seconds that user files are kept in the
# auth directory before the program removes them. 2-6 hours is
# probably a good value.
$auth_time = 21600; # 6 hours (in seconds)

# Enable (1) or disable (0) logging.
$auth_logging = 1;

# Allow a default user? This means you can specify a user via the URL
# and skip the logon process. Use this to allow people to search without
# logging on, but require log in if they want to add/modify/remove etc.
# (1 = "yes", 0 = "no")
$auth_allow_default = 1;

# Default permissions used if there is no authentication, or for a default
# user. (View, Add, Delete, Modify, Admin), 1 = enable, 0 = disable.
@auth_default_permissions = (1,0,0,0,0);

# Allow people to sign up for their own userid/passwords? They will
# recieve default permissions.
$auth_signup = 0;

# Permissions a new signup should get.
@auth_signup_permissions = (1,1,1,1,1);

# Registered users: can modify/delete _only_ own records. For this to make
# sense you should set default off or to 1,0,0,0.
$auth_modify_own = 0;

# Registered users: can view _only_ own records. For this to make sense
# you should turn off default permissions.
$auth_view_own = 0;

# Auth user field. This is the field position in the database used for storing
# the userid who owns the record. Set to -1 if not used.
$auth_user_field = -1;

Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
I received this error message now when clicking the send record button:

DBMan encountered an internal error.


CGI ERROR
==========================================
Error Message : fatal error: Undefined subroutine &main::html_record_long called at ./html.pl line 1254.

Script Location : /usr/local/etc/httpd/cgi-bin/seg/dbman/db.cgi
Perl Version : 5.00404
Setup File : default.cfg
User ID : admin
Session ID : admin.98270391548545

Form Variables
-------------------------------------------
CaseNo. : cscdf45
db : default
forward_email_form : 1
uid : admin.98270391548545

Environment Variables
-------------------------------------------
DOCUMENT_ROOT : /usr/local/etc/httpd/htdocs
GATEWAY_INTERFACE : CGI/1.1
HTTP_ACCEPT : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
HTTP_ACCEPT_CHARSET : iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en
HTTP_CONNECTION : Keep-Alive
HTTP_HOST : golf.cisco.com
HTTP_REFERER : http://golf.cisco.com/cgi-bin/seg/dbman/db.cgi?db=default&uid=admin.98270391548545&view_records=1&CaseNo.=*
HTTP_USER_AGENT : Mozilla/4.73 [en]C-CCK-MCD (Windows NT 5.0; U)
PATH : /users/matt/share/bin:/users/matt/SunOS/bin:/sw/current/solaris2bin:/router/bin:/gsg-sw/share/bin:/gsg-sw/inst/solaris/bin:/usr/local/bin:/usr/local/ddts/bin:/bin:/usr/bin:/gsg-sw/share:/gsg-sw/inst/share/bin:/gsg-sw/inst/solaris/0.4d0/bin:/usr/X11/bin:/usr/X11R6/bin:/usr/X11R6/bin/sbin:/usr/openwin/bin:/usr/sbin:/etc:/usr/ucb:/usr/local/share/bin:.
QUERY_STRING : db=default&uid=admin.98270391548545&CaseNo.=cscdf45&forward_email_form=1
REMOTE_ADDR : 10.34.3.38
REMOTE_HOST : dhcp-10-34-3-38.cisco.com
REMOTE_PORT : 1901
REQUEST_METHOD : GET
SCRIPT_FILENAME : /usr/local/etc/httpd/cgi-bin/seg/dbman/db.cgi
SCRIPT_NAME : /cgi-bin/seg/dbman/db.cgi
SERVER_ADMIN : [no address given]
SERVER_NAME : golf.cisco.com
SERVER_PORT : 80
SERVER_PROTOCOL : HTTP/1.0
SERVER_SOFTWARE : Apache/1.2b7
TZ : PST8PDT



Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
Are you using the short/long mod?

If so in this sub:

sub html_forward_email_form {
#----------------------------------------------------------


my ($message) = $_[0];
$in{$db_key} =~ s/<?.B>//g;

instead of:
%rec = &get_record($in{$db_key});

try using:

%rec = &get_record_long($in{$db_key});

If this does not help, please save your html.pl and db.cgi files as text files and provide a url so we can look at them.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Send Record (no record received) Problem In reply to
Send record is still not working

The database is on an internal web site so there's no way to actually view the page; however, i have saved db.cgi, html.pl, and default.db as text files and you can view the files at the following urls:

http://www.geocities.com/reena_sud/default.txt
http://www.geocities.com/reena_sud/db.txt
http://www.geocities.com/reena_sud/html.txt

i appreciate ur help...thank you very very very much!!

Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
Reena, I haven't compared the .cgi file however, after comparing the html.pl file on a sample database using this mod, I spotted a slight difference in the coding. Perhaps this will help resolve the problem you're having.

My code looks like this (highlighted differences in red) - I created a global value $site_url for the website address:

$in{'email_message'} = qq|$site_url
$html_title has a listing which you may be interested in.

|;

unless ($in{'email_message'}) {
foreach $col (@db_cols) {
$in{'email_message'} .= "$col: $rec{$col}\n";
}
}

$page_title = "Send an Email";
&html_page_top;

if ($message) { print qq|There was a problem: $message|; }
print qq|
<$font>Fill in your email address & the recipient's email address. You can also include a message.</font>
|;

print qq|
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$in{$db_key}">
<input type="hidden" name="subject" value="$rec{'Title'}">
<table><tr><td align=right><$font>Your email address:</font></td>
<td><input type=text name="email" value="$in{'email'}" size=40></td></tr>
<tr><td align=right><$font>Recipient's email address:</font></td>
<td><input type=text name="to_email" value="$in{'to_email'}" size=40></td></tr>
<tr><td align=right><$font>Your message:</font></td>
<td><textarea name="emailmessage" cols=40 rows=10 wrap="virtual">$in{'email_message'}</TEXTAREA></td></tr>
</table>


Quote Reply
Re: Send Record (no record received) Problem In reply to
Hi Karen,
Well i'm not sure I understand what your saying. What exactly do i need to change in my html.pl file? do i need to add the portion that you highlighted in red?

Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
Reena, I am guessing that since you have some huge fields (character counts) in your database, you are not wanting to send the entire record by email. If you do not want to email the entire record, add this portion of my code:

$in{'email_message'} = qq|$site_url
$html_title has a listing which you may be interested in.

|;

and include the fields or text you want to send.

You'll need to correct this portion of your code, regardless of what content you're sending in the email:

<textarea name="emailmessage" cols=40 rows=10 wrap="virtual">$in{'email_message'}</TEXTAREA>



Quote Reply
Re: Send Record (no record received) Problem In reply to
Okay well now I got the send record window to come up. Now the problem is the recipient never actually receives the record; however, after the send record button is pushed it says the record has been sent successfully...what could be the problem?

You can view the updates scripts at the following urls:

<html>
<body>

<p><a href="http://www.geocities.com/reena_sud/dbcgi.txt">http://www.geocities.com/reena_sud/dbcgi.txt</a>

<a href="http://www.geocities.com/reena_sud/defaultcfg.txt">http://www.geocities.com/reena_sud/defaultcfg.txt</a>

<a href="http://www.geocities.com/reena_sud/html.txt">http://www.geocities.com/reena_sud/html.txt</a>

</p>

</body>

</html>


thank you for your help =)


Reena
Quote Reply
Re: Send Record (no record received) Problem In reply to
Reena, I'm not a guru on perl or anything - can't tell 'ya why other than the 1; is the end of the perl file but, you need to move your new subs above the sub html_print_headers in your html.pl file.


Also, in your default.cfg file, the path to sendmail which you've identified is not the same as what the instructions call for. You have:

# Full path to sendmail program
$mailprog = "/usr/lib/sendmail";

The instructions call for:

# Full path to sendmail on your system
$mailprog = "|/usr/lib/sendmail -t -oeq";

The pipe and flags are needed. You only change the actual path portion which I've highlighted in blue above.

Try those corrections and let me know how it goes Smile


Quote Reply
Re: Send Record (no record received) Problem In reply to
IT WORKS!!!! thank you so much!!! =) I'm now a very happy woman hahaha

Reena