Mail failure - malformed recipient address

Issues related to forms.
Post Reply
AJM
 
 
Posts: 1
Joined: Wed Feb 20, 2019 2:53 pm

Mail failure - malformed recipient address

Post by AJM »

I try to use the PHP formprocessor to make an email response form

I constantly receive mail in response with this header
---------------------------------
Mail failure - malformed recipient address
---------------------------------
and in the email:

A message that you sent contained one or more recipient addresses that were incorrectly constructed:

x@x.com <x@x.com>: malformed address: <x@x.com> may not follow x@x.com

This address has been ignored. The other addresses in the message were syntactically valid and have been passed on for an attempt at delivery.

I changed the emailaddress in x@x in this example
but the email address used is not malformed...... I am sure

so after a few hours of trying i give up for this moment
maybe.. someone has a solution

I use wysiwyg v12
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

The email address should not include: <x@x.com>
A valid email address looks like this:
x@x.com
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Wed Feb 20, 2019 6:28 pm The email address should not include: <x@x.com>
A valid email address looks like this:
x@x.com
Sorry to necro bump but I am also having this issue, In my settings I have it set to email@address.com without any < > but I still get the same error.
The form is working as all the info I submitted is in there at the bottom but its not coming through correctly since I added the captcha?
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

To be able to help you, I need to know all your settings.
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Fri May 01, 2020 8:17 pm To be able to help you, I need to know all your settings.
https://drive.google.com/file/d/1hfT3e9 ... sp=sharing
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

I do not see any errors in the configuration.
What is the generated PHP code?
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Sat May 02, 2020 6:28 am I do not see any errors in the configuration.
What is the generated PHP code?
Of the actual page?

<?php
if (session_id() == "")
{
session_start();
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'flexgrid1')
{
if (isset($_POST['captcha_code'],$_SESSION['random_txt']) && md5($_POST['captcha_code']) == $_SESSION['random_txt'])
{
unset($_POST['captcha_code'],$_SESSION['random_txt']);
}
else
{
$errorcode = file_get_contents('./form-fail.html');
$replace = "##error##";
$errorcode = str_replace($replace, 'The entered code was wrong.', $errorcode);
echo $errorcode;
exit;
}
}
?>
<?php
function ValidateEmail($email)
{
$pattern = '/^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i';
return preg_match($pattern, $email);
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['formid']) && $_POST['formid'] == 'flexgrid1')
{
$mailto = 'form@warped-tactical.co.uk';
$mailfrom = 'form@warped-tactical.co.uk';
ini_set('sendmail_from', $mailfrom);
$mailname = 'Nobody';
$subject = 'Warped Tac Form';
$message = 'Values submitted from web site form:';
$success_url = './Form-Ok.html';
$error_url = './form-fail.html';
$eol = "\n";
$error = '';
$internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field", "g-recaptcha-response");
$boundary = md5(uniqid(time()));
$header = 'From: '.$mailname.' <'.$mailfrom.'>'.$eol;
$header .= 'Reply-To: '.$mailfrom.$eol;
$header .= 'MIME-Version: 1.0'.$eol;
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;
$header .= 'X-Mailer: PHP v'.phpversion().$eol;

try
{
if (!ValidateEmail($mailfrom))
{
$error .= "The specified email address (" . $mailfrom . ") is invalid!\n<br>";
throw new Exception($error);
}
$message .= $eol;
$message .= "IP Address : ";
$message .= $_SERVER['REMOTE_ADDR'];
$message .= $eol;
foreach ($_POST as $key => $value)
{
if (!in_array(strtolower($key), $internalfields))
{
if (!is_array($value))
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol;
}
else
{
$message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol;
}
}
}
$body = 'This is a multi-part message in MIME format.'.$eol.$eol;
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;
$body .= $eol.stripslashes($message).$eol;
if (!empty($_FILES))
{
foreach ($_FILES as $key => $value)
{
if ($_FILES[$key]['error'] == 0)
{
$body .= '--'.$boundary.$eol;
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;
$body .= 'Content-Transfer-Encoding: base64'.$eol;
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;
}
}
}
$body .= '--'.$boundary.'--'.$eol;
if ($mailto != '')
{
mail("{$mailto} <{$mailto}>", $subject, $body, $header, '-f'.$mailfrom);
}
header('Location: '.$success_url);
}
catch (Exception $e)
{
$errorcode = file_get_contents($error_url);
$replace = "##error##";
$errorcode = str_replace($replace, $e->getMessage(), $errorcode);
echo $errorcode;
}
exit;
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact Warped Tactical command!</title>
<meta name="description" content="Contact Warped Tactical command for all your enquiries!">
<meta name="keywords" content="Tactical, Paintball, Team, Scenario, West Midlands, Shropshire, Cosford, Warped, Squad, Wolverhampton, Telford, Shifnal, Shrewsbury, Birmingham, paint, ball, ">
<meta name="author" content="Andy Johnson">
<meta name="generator" content="WYSIWYG Web Builder 15 - http://www.wysiwygwebbuilder.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="32X32.png" rel="icon" sizes="32x32" type="image/png">
<link href="64X64.png" rel="icon" sizes="64x64" type="image/png">
<link href="wb.validation.css" rel="stylesheet">
<link href="WARPED_TAC.css" rel="stylesheet">
<link href="Contact-Us.css" rel="stylesheet">
<script src="jquery-1.12.4.min.js"></script>
<script src="wb.overlay.min.js"></script>
<script src="wb.validation.min.js"></script>
<script>
function submitwarped_tac_form()
{
var regexp;
var Editbox2 = document.getElementById('Editbox2');
if (!(Editbox2.disabled || Editbox2.style.display === 'none' || Editbox2.style.visibility === 'hidden'))
{
regexp = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
if (!regexp.test(Editbox2.value))
{
alert("Please use a valid email address.");
Editbox2.focus();
return false;
}
if (Editbox2.value == "")
{
alert("Please use a valid email address.");
Editbox2.focus();
return false;
}
}
return true;
}
</script>
<script>
$(document).ready(function()
{
$("#FlexGrid1").submit(function(event)
{
var isValid = $.validate.form(this);
return isValid;
});
var $overlaymenu = $('#OverlayMenu1-overlay');
$overlaymenu.overlay({'hideTransition':true});
$('#OverlayMenu1').on('click', function(e)
{
$.overlay.show($overlaymenu);
return false;
});
$("#Checkbox1").change(function()
{
if ($('#Checkbox1').is(':checked'))
{
$('#Button1').prop('disabled', false);
}
if (!$('#Checkbox1').is(':checked'))
{
$('#Button1').prop('disabled', true);
}
});
$("#Checkbox1").trigger('change');
$("#Captcha1").validate(
{
required: true,
type: 'ajax',
param: 'captcha1_ajax.php',
color_text: '#000000',
color_hint: '#00FF00',
color_error: '#FF0000',
color_border: '#808080',
nohint: true,
font_family: 'Arial',
font_size: '13px',
position: 'centerright',
offsetx: 0,
offsety: 0,
bubble_class: 'bubbleleft',
effect: 'fade',
error_text: 'Please try again.'
});
});
</script>
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

It looks like you have enabled 'include envelope sender' in the form properties.
Please uncheck this option.
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Sat May 02, 2020 10:14 am It looks like you have enabled 'include envelope sender' in the form properties.
Please uncheck this option.
Where do I find that exactly?

I can find one that says "set envelope from address for PHP" but that is already unchecked and I cant find anything else similar?

Cheers.
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

The code indicates that this option is checked.
Please make sure none of your forms have this option enabled, unless you have a good reason to do so.
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Sat May 02, 2020 12:17 pm The code indicates that this option is checked.
Please make sure none of your forms have this option enabled, unless you have a good reason to do so.
Pablo wrote: Sat May 02, 2020 12:17 pm The code indicates that this option is checked.
Please make sure none of your forms have this option enabled, unless you have a good reason to do so.
I am not sure how or where it would of been turned on though?

To my knowledge I didnt do it but I cant find that setting in the form properties to check?
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

If you need further assassinate then please share a demo project so I can see all your settings.

Related FAQ:
http://www.wysiwygwebbuilder.com/forum/ ... 10&t=82134
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Sat May 02, 2020 1:24 pm If you need further assassinate then please share a demo project so I can see all your settings.

Related FAQ:
http://www.wysiwygwebbuilder.com/forum/ ... 10&t=82134
WBS here:
https://drive.google.com/file/d/1PhlzkG ... sp=sharing

The form is on the contact page.
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

I have checked the code of the contact page in your project, but its' different than the code you have posted on the forum.
Is this the same page?

Also, the form on your website seems to work correct:
http://warped-tactical.co.uk/Contact-Us.php
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Pablo wrote: Sat May 02, 2020 2:35 pm I have checked the code of the contact page in your project, but its' different than the code you have posted on the forum.
Is this the same page?

Also, the form on your website seems to work correct:
http://warped-tactical.co.uk/Contact-Us.php
That's weird it just come through ok??

Could that of been caused by some kind of server side error?
User avatar
Pablo
 
Posts: 21585
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Mail failure - malformed recipient address

Post by Pablo »

How did you get the error?
lilandy
 
 
Posts: 34
Joined: Wed Apr 29, 2020 9:29 am

Re: Mail failure - malformed recipient address

Post by lilandy »

Well it was from just sending the form but it seems to of fixed itself :roll:

Never mind its working LOL
Post Reply