close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Getting email To to include email field in form

Thread began 1/22/2011 11:17 am by Sally | Last modified 1/25/2011 9:51 am by Jason Byrnes | 1777 views | 13 replies |

Sally

Getting email To to include email field in form

I have a emailed form where a user fills in a field with an email address which is supposed to be included in the To recipient list. This seems like it should be easy, but I'm having a hard time with it. The code currently is

$RecipArray[$CurIndex ][] = "".((isset($_POST["GuestEmail"]))?$_POST["GuestEmail"]:"") ."";

Can anyone tell me where I'm going wrong?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

the code looks correct. I will need a copy of the entire page though to see the code in context.

Sign in to reply to this post

Sally

Thanks for looking at it.

Attached Files
Guest_Info.zip
Sign in to reply to this post

Jason ByrnesWebAssist

Is the email going to the other recipients, just not the Guest Email address?

If the email is going out to the other recipients, you will need to contact the host to have them look into smtp server error logs to see why the email is not being relayed to the guest email address.

Sign in to reply to this post

Sally

Hmm, this is curious.

I // out the two static email addresses and tested it and it worked - I got both my copy as the sender, and to the guest's email I provided.

So I added the static addresses back, but after

$RecipArray[$CurIndex ][] = "".$row_rs_session['txtemail'] ."";
$RecipArray[$CurIndex ][] = "".((isset($_POST["GuestEmail"]))?$_POST["GuestEmail"]:"") ."";

and I got the one for me (as the sender) but not the one to the guest's email address. I've asked the static recipients to let me know if they got them, but they aren't by a computer so I don't know.

I do know the two static email addresses are valid as I've tested other forms that go to them and they've gotten them. Plus I don't think the form would fail just because of an invalid email address.

Just for grins, I tested a plain old Contact form and it came through to my static email address fine.

I've attached the support files in case you can spot any reason for this.

Attached Files
waue_Guest_Info_1.zip
Sign in to reply to this post

Jason ByrnesWebAssist

one thing to try is to go to the Universal Email behavior and set the Goto page to be blank.

then edit the webassist/email/mail_php.php file.


find the following code:

php:
if ( $mailObj)  {
        $_SESSION[$mailRef."_Status"] = "Success";
        $_SESSION[$mailRef."_Log"] .=  "Success <br>\n";
    }
    else  {
        $_SESSION[$mailRef."_Status"] = "Failure";
        $_SESSION[$mailRef."_Log"] .=  $_SESSION[$mailRef."_Error"]. " - Failure <br>\n";
    }
    return $mailObj;





and change it to:

php:
if ( $mailObj)  {
        $_SESSION[$mailRef."_Status"] = "Success";
        $_SESSION[$mailRef."_Log"] .=  "Success <br>\n";
    }
    else  {
        $_SESSION[$mailRef."_Status"] = "Failure";
        $_SESSION[$mailRef."_Log"] .=  $_SESSION[$mailRef."_Error"]. " - Failure <br>\n";
    }
        echo($mailTo."-"$_SESSION[$mailRef."_Status"]."<br />");
    return $mailObj;



this will write to the screen each to address being used and it's status for passing the message to the SMTP server, post this information back.

Sign in to reply to this post

Sally

Now when I try and load the page I get this error:

Parse error: syntax error, unexpected T_VARIABLE in /data/25/2/98/45/2424045/user/2657060/htdocs/test/webassist/email/mail_php.php on line 299

line 299 says

echo($mailTo."-"$_SESSION[$mailRef."_Status"]."<br />");

Sign in to reply to this post

Jason ByrnesWebAssist

sorry, had a syntax error, that line should be:
echo($mailTo."-".$_SESSION[$mailRef."_Status"]."<br />");

Sign in to reply to this post

Sally

It said all were sent successfully, and I did get my two. Again, I don't know about the two static email addresses yet, but this appears to be working.


But I didn't change anything except remove the confirmation page and put in this echo code, so now I'm wondering why?

Sign in to reply to this post

Jason ByrnesWebAssist

if it is reporting success, that means that the email has been handed over to the servers SMTP server.

At this point, it is up t o the smtp server to relay the email messages to the recipients, i the recipients are not getting the emails, then you need to contact the host to have them look into the smtp server error logs to see why the emails are not being relayed.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...