Jump to content

TheLovableCodeyMan

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by TheLovableCodeyMan

  1. Oohhh yes, what was that saying exactly? Let's see - oh yes, that's right: something about a workman being unable to do a job with shit tools & a shit platform? That the one?
  2. I'm sorry but when one email is sent and one isn't, then that's just absolutely stupid and ridiculous. They use the same server credentials and this has works flawlessly before. I am genuinely so angry, so fuming, right now I could absolutely scream! I am so so sick to the back teeth of ripping my hair out just because someone one day said "Hey, I know what I will do, I'm going to invent a code that will piss everyone off and waste everyone's time, because I'm a total psychopath. I'm going to invent coding language that will just have a mind of it's own!" . OK so my code has decided "I know what I'm going to to, I'm going to send one email, but you know what? Just because I feel like a total arse today, I'm just not going to send the other email" That is the only explanation I can come up with. I have tried to be calm, I have tried to be patient but this piece of crap is getting on my last nerve. It's code, not a disobedient child! I tell it to do something, it does it. It gives me errors through diagnostic coding, I correct those errors, it's fixed. But oh no, because as soon as I fix one error it says "Oh, sorry, me had, I forgot to tell you, there's also this error as well..." It's code. It's not an emotional, indecisive human, IT'S BLOODY CODE! It's that simple. The sooner code starts behaving like code and not a stupid dumb human being, the happier everyone will be.
  3. Lol you're telling me! Finicky isn't the word, the words "absolute" and "pig" more like! 😄
  4. I appreciate that, but this was worked flawlessly previously, now it's decided it doesn't want to know. This is why I'm fuming.
  5. I did, it's going to the Thank You page, but when I do: I get the "echo" message but no diagnostic information - so still no idea why the code/server is deciding to not do as it's told. I'm going to come back to this tomorrow but I'm trying to keep my cool with this but it's just not working. Everything I try just does not want to know and even the diagnostics is giving me no reason for this, & right now I'm really beginning to lose my patience with this, I'm getting no error messages, warnings etc but I am getting just the: "Message failed. Try again"; which helps about as much as a chocolate fireguard.
  6. Sorry, just reread your post. This is what happens when you code and servers decide they're going to take a day off and I'm famished, the issues still persists, I'm getting the confirmation email but not getting the form information, and yes, I have turned on at the top of the page right after the first opening tag.
  7. The website is for the UK market, so its irrelevant for over here, but it's going to be integrated into a US branch soon. so was easier to just disable this as opposed to coding in later on. Could this be a problem for this situation? Because I can feel my blood pressure starting to rise now, every time I run the suggested diagnostic testing, it throws up more errors, which I rectify, only to throw up even more errors.
  8. UPDATE - Revised Code, same problem <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $title = $_POST['title']; $first = $_POST['first']; $surname = $_POST['surname']; $email = $_POST['email']; <!--sender@xyz.com--> $internationalCode = $_POST['internationalCode']; $number = $_POST['number']; $userMessage = $_POST['userMessage']; $company = $_POST['company']; $Industrytype = $_POST['Industrytype']; $inc_status = $_POST['inc_status']; $state = $_POST['state']; $email_from = "$first $surname <apikey>"; $Password = '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'; $email_subject = "Website Enquiry from $first $surname"; $messageTo = "sender@xyz.com"; $email_body = "User title: $title. \n". "User First Name: $first. \n". "User Surname Name: $surname. \n". "User email: $email. \n". "International Dialing Code: $internationalCode. \n". "User Contact Number: $number. \n". "Company Name: $company. \n". "Incorporation Status: $inc_status. \n". "Industry type: $Industrytype. \n". "User Message is: $userMessage. \n". "State of Incorporation: $state. \n"; $headers = "From: $email_from"; mail($messageTo, $email_subject, $email_body, $headers, "-fweb-support@xyz.co.uk"); header('Location: https://www.xyz.com/help/thank_you.html'); $respond_subject = "Thank you for your message"; /* Prepare autoresponder message */ $respond_message = " Hi $first, Thank you for messaging to us. We will aim to reply to you within 24 hours. In the meantime, why not follow our other stories via, as well as following, our Facebook page. Simply go to https://www.facebook.com/xyz/ or Message us on Facebook at http://m.me/xyz To see how your data is processed, please visit our Data Protection Policy here: https://www.xyz.com/privacy/privacy_central.html Yours sincerely, xxx"; $headers = 'From: xyz <notifications@xyz.co.uk>' . "\r\n" . 'Reply-To: $email' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); /* Send the message using mail() function */ mail($email, $respond_subject, $respond_message, $headers, "-fno-reply@xyz.co.uk"); //} ?>
  9. Ah, first or second? If your first, people have varying side effects but I was fine, had what felt like a bruise for a few days but other than that I was perfecto. So I did the following: & had the following message Line 34 is: I don't see why this, of all things, wound hinder the process. But it looks like this is the culprit.
  10. Lol not quite, the confirmation email is being sent to sender@xyz.com - which is brilliant - but no form information is being sent to receiver@xyz.com. Looking at the SMTP activity records with SendGrid, the "receiver" email address is not mentioned anywhere, so the server is not even attempting to send the form data. There are no block or suppressions on SendGrid either - I checked as I have been caught out by that before 😄 The receiver@xyz.com is still the issue 😄
  11. So a wee update for you's all (No idea why I launched into Scottish there - I'm from nowhere near Scotland!) 😄 I'm no longer receiving error messages - which is good - It goes straight to the "Thank you" page - which is good, and the Confirmation Email is being received with no issues. Looking at the SMTP activity, the receiver@xyz.om is not recorded anywhere, so it's not even attempting to send the form information.
  12. Awesome, so placing immediately after the: so therefore: Is that correct? Regards The LovableCodeMan
  13. Sure, I've tweaked some changed and have managed to reduce this down to: Notice: Array to string conversion in /homepages/4/d860010751/htdocs/scripts/mail.php on line 32 Warning: Cannot modify header information - headers already sent by (output started at /homepages/4/d860010751/htdocs/scripts/mail.php:32) in /homepages/4/d860010751/htdocs/scripts/mail.php on line 42 Which makes no sense because line 32 is ""State of Incorporation: $state.\n"."
  14. The code is fine, as an update, the confirmation email from the sender is received Hello there, I have inserted diagnostic code immediate after the opening PHP tag <? (Which is great to know, by the way, I never knew this) & I get the following: Notice: Undefined variable: department in /homepages/4/d860010751/htdocs/scripts/mail.php on line 27 Notice: Array to string conversion in /homepages/4/d860010751/htdocs/scripts/mail.php on line 33 Notice: Undefined variable: attachment in /homepages/4/d860010751/htdocs/scripts/mail.php on line 34 Warning: Cannot modify header information - headers already sent by (output started at /homepages/4/d860010751/htdocs/scripts/mail.php:27) in /homepages/4/d860010751/htdocs/scripts/mail.php on line 43 Also, I'm still getting the confirmation email to (sender@xyz.com) - which is good, but still not receiving the information submitted in the form. Also checking the SMTP suppliers records, yes, the sender@xyz.com has been treated as "Delivered" which is true, and the receiver@xyz.com as "Processed" All the best, The LovableCodeMan!
  15. Greetings Fellow PHPFreaks! LovableCodeMan here - newbie to this forum an pretty new to this PHP thing that all these youngsters are raving about - who knew?! Anyway, so I have an HTML form set up with a PHP document attached in order to send the data from the form to an email -a pretty basic setup by todays standards. In the PHP document, you can see that there is a section for the user (sender@xyz.com) to submit the information in the form to us & is sent to our email address "receiver@xyz.com". The bottom segment is to send a confirmation email back to the sender - to "sender@xyz.com" - as a thank you and a "We will get back to you ASAP" etc etc etc. The confirmation email sent to the sender@xyz.com works flawlessly when pressing the "Send Your Message" button, but then I just see "https://www.xyz.com/scripts/mail.php" in the address bar and no email is received by receiver@xyz.com - aka "Us". This is the PHP document - confidential information redacted & the "sender@xyz.com" & "receiver@xyz.com" replace the real email addresses. <!doctype html> <?php $title = $_POST['title']; $first = $_POST['first']; $surname = $_POST['surname']; $email = $_POST['email']; <!------- sender@xyz.com---> $internationalCode = $_POST['internationalCode']; $number = $_POST['number']; $userMessage = $_POST['userMessage']; $company = $_POST['company']; $Industrytype = $_POST['Industrytype']; $inc_status = $_POST['inc_status']; $state = ['state']; $email_from = "$first $surname <smtp server login>"; $Password = 'smtp server password'; $email_subject = "Website Enquiry from $first $surname"; $messageTo = "receiver@xyz.com"; $email_body = "User title: $title. \n". "The department this message is for is: $department.\n". "User First Name: $first.\n". "User Surname Name: $surname. \n". "User email: $email.\n". "International Dialing Code: $internationalCode. \n". "User Contact Number: $number.\n". "State of Incorporation: $state.\n". "File: $attachment.\n". "Company Name: $company, $inc_status.\n". "Industry type: $Industrytype.\n". "User Message is: $userMessage.\n"; $headers = "From: $email_from" . "\r\n" . "Reply to: $first $surname". "\r\n"; mail($messageTo, $email_subject, $email_body, $headers, "-fweb_support@xyz.com"); header('Location: https://www.xyz.com/thank_you.html'); <!--------Confirmation email send to sender@xyz.com below----------------> $respond_subject = "Thank you for your message"; /* Prepare autoresponder message */ $respond_message = " Hi $first, Thank you for messaging to us. We will aim to reply to you within 24 hours. In the meantime, why not follow our other stories via, as well as following, our Facebook page. Simply go to https://www.facebook.com/xyz/ Yours sincerely, The Support Team receiver@xyz.com. "; $headers = 'From: <Sender> <no-reply@xyz.com>' . "\r\n" . 'Reply-To: $email' . "\r\n" .<!------- sender@xyz.com---> 'X-Mailer: PHP/' . phpversion(); /* Send the message using mail() function */ mail($email, $respond_subject, $respond_message, $headers, "-fno-reply@xyz.com"); //} ?> This is the HTML document: <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> </head> <body> <form role="form-inline" method="POST" action="../scripts/mail.php"> <div class="form-group"> <div class="row"> <div class="col-lg-2 col-md-4 col-sm-4 col-xs-4 select "> <select class="" id="standard-select" name="title"> <option selected disabled>Title *</option> <option>Dr.</option> <option>Mr.</option> <option>Mrs.</option> <option>Ms.</option> <option>Prof.</option> <option>Rev.</option> <option>Pastor.</option> <option>Miss.</option> </select> </div> <div class="col-lg-4 col-md-4 col-sm-8 col-xs-8"> <input name="first" type="text" placeholder="First Name *" required/> </div> <div class="col-lg-6 col-md-4"> <input name="surname" type="text" placeholder="Surname *" required/> </div> </div> <div class="row"> <div class="col-lg-6 col-md-4 col-sm-6 col-xs-12"> <input name="email" type="email" placeholder="Email *" required/> </div> <label for="standard-select"></label> <div class="col-lg-2 col-md-4 col-sm-6 col-xs-5 select"> <select class="" name="internationalCode" id=""> <option data-countryCode="GB" value="44" Selected>UK (+44)</option> <option data-countryCode="US" value="1" >USA (+1)</option> <optgroup label="Other countries"> <option data-countryCode="DZ" value="213">Algeria (+213)</option> <option data-countryCode="AD" value="376">Andorra (+376)</option> <option data-countryCode="AO" value="244">Angola (+244)</option> <option data-countryCode="AI" value="1264">Anguilla (+1264)</option> <option data-countryCode="AG" value="1268">Antigua &amp; Barbuda (+1268)</option> <option data-countryCode="AR" value="54">Argentina (+54)</option> <option data-countryCode="AM" value="374">Armenia (+374)</option> </optgroup> </select> </div> <div class="col-lg-4 col-md-4 col-sm-12 col-xs-7"> <input type="tel" name="number" placeholder="Telephone Number *" required/> </div> </div> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 select"> <select name="inc_status" required> <option selected disabled>Incorporation status *</option> <option>Limited by Guarantee</option> <option>Limited by Shares</option> <option>CIC</option> <option>CIO</option> <option>Unincorporated</option> <option>LLP</option> <option>LLC</option> <option>Other</option> </select> </div> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 select"> <select name="state" disabled> <option selected disabled>State of incorporation *</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="DC">District Of Columbia</option> <option value="FL">Florida</option> </select> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <input name="company" type="text" placeholder="Company *" required/> </div> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 select"> <select class="" name="Industrytype" id="select" value=""> <option selected disabled value="">Industry *</option> <option value="Appraisal/Disposition">Appraisal/Disposition</option> <option value="Business Services">Business Services</option> <option value="Consulting">Consulting</option> <option value="Business Broker">Business Broker</option> <option value="Distribution">Distribution</option> <option value="Education">Education</option> <option value="Financial Services (Non-Lender)">Financial Services (Non-Lender)</option> <option value="Government">Government</option> <option value="Healthcare">Healthcare</option> <option value="Insurance">Insurance</option> <option value="Investment Banking">Investment Banking</option> <option value="Law">Law</option> <option value="Lender">Lender</option> <option value="Logistics">Logistics</option> <option value="Manufacturing">Manufacturing</option> <option value="Media/Print/Broadcast/Internet">Media/Print/Broadcast/Internet</option> <option value="Other">Other</option> <option value="Private Equity/Venture Capital">Private Equity/Venture Capital</option> <option value="Real Estate Services">Real Estate Services</option> <option value="Receivables">Receivables</option> <option value="Retail">Retail</option> <option value="Technology">Technology</option> <option value="Turnaround/Restructuring">Turnaround/Restructuring</option> <option value="Utility">Utility</option> <option value="Wholesale">Wholesale</option> </select> </div> </div> <div class="row"> <div class="col-lg-12"> <textarea name="userMessage" placeholder="Please type your message here. Do not include any personal information such as your NIN or any banking information."></textarea> </div> </div> <div class="row"> <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12"> <div class="" style="background-color: #E0DDDD; padding: 20px;"> <p style="font-size: 12px; color: #0d0155">Information is held under the provision of the General Data Protection Regulation (GDPR). We will not pass your details on to any other organisation. We will process your information in accordance with our privacy policy. By send this message, you agree to xxxxxxx's <a style="color: #0D0155; text-decoration: underline;" href="/privacy/online_privacy_notice.html" target="_new" class="inline_link__new_window">Online Privacy Policy</a> </p> </div> </div> <div class="col-lg-6 col-md-12 col-sm-12 col-xs-12"> <input type="submit" id="submit" name="submit" value="Send your message"/> </div> </div> </div> </form> </body> </html> Anyone know where I'm going wrong, it "half works" so I'm Half Way There - & yes, I am Livin' on a Prayer! Thanks in advance! The LovableCodeman
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.