php - A simple email client/contact form is returning a "5.5.4 Invalid Domain Error" and I have exhausted all my resources attempting to solve it -


I have posted this question twice in the last two days and I have actually run dry solutions. I am preparing a very simple comment box which sends my company's security department by filling comments in the email. I am getting 5.5.4 invalid domain errors for the last 5.5 days.

This is SMTP and TLS port and server name is correct. The server allows anonymous email, and does not validate. I am using SwiftMolder Library so I do not need an ELHO / HELO script. The only asset to email that is not defined / hard coded is the message body. This is the code for my controller (index.php).

  // Swift Mailer Library is required_once (". Swiftmailer / lib / swift_required.php"); // Class in which the information of the e-mail is sent in (from, to, etc.) Need_once ("./ classes / EmailParts.php"); // "breaks" the data sent with the HTML form in a high "useful" format requires_once ("./categories/ContactForm.php"); // =================================================== Main configuration ("EMAIL_SUBJECT", "Security Concerns"); Define ("EMAIL_TO", "safetydepartment@company.com"); Define ("EMAIL_FROM", "securitydepartment@company.com"); // Define SMTP configuration ("SMTP_SERVER", 'exchange.company.local'); Define ("SMTP_PORT", 25); Function Main ($ contact form) {// Check if something was sent on contact form, if not, do nothing (! $ ContactForm- & Data; DataSent ()) {return; } // validates the contact form and checks for $ $ contact form- & gt; Valid (); $ Errors = Array (); // If the contact form is not valid: if (! $ ContactForm-> isValid ()) {// error $ errors $ errors = $ contactForm- & gt; There is an error in getErrors (); } Else {// If the contact form is valid: try {// contact form send email created with $ result = sendEmail ($ contactForm); // After the email is sent, the redirect and "die" // we redirect to refresh the page which sends the form header again ("location: ./success.php"); Die (); } Hold (exception $ E) {// An error occurred while sending an email // Log the error and add an error message to display the user. Error_log ('An error occurred while sending the email contact form:' $ E- & gt; getMessage ()); $ Errors ['oops'] =' Oh! An error occurred while sending your email! Try again later! '; }} Return $ errors; } // Contact Form Function sendEmail ($ contactForm) {// Email sends emails based on the information contained in the email part, email information is required to send an email based on the // contact form $ email inside Was inserted = new email pars ($ contact form); // This is the part where we initialize Swift Mailer with // All the information started by Email Preference Email $ Email Message = SwiftMagazine :: New Instance () - & gt; Setcubes ($ emailParts- & gt; getSubject ()) - & gt; Setfram ($ EmailParts- & gt; getFrom ()) - & gt; Settau ($ emailParts- & gt; getTo ()) - & gt; SetBode ($ emailParts- & gt; getBodyMessage ()); // another swiftmailer configuration .. $ transport = swift_ smtpTransport :: newInstance (SMTP_SERVER, SMTP_PORT, 'Tls'); $ Mailer = SwiftMailer :: New Instance ($ transport); $ Result = $ Mailer- & gt; Send ($ email message); Return result; } // Start ContactForm with information about the form and the potentially uploaded file. $ ContactForm = New ContactForm ($ _ POST, $ _FILES); // Call the "main" method This will return a list of errors $ Errors = Main ($ contact form); // Call the "contact form" view to display the HTML contact form. Require_once ("./ ideas / contactForm.php");  

I have completely posted my code. Not too much, but I think the problem should lie in the index.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -