ValidateAddress on PHPMailer behaves odd

I'm using PHPMailer and $mail->Send() is returning an error, my problem is when I use this email-string "[email protected]" within $mail->SetFrom(), but in the other hand it works fine with almost any other email i.e "[email protected]".

After debugging the code I found out that the problem is in the file class.phpmailer.php over the function ValidateAddress(). It seems that the email "[email protected]" is not valid by FILTER_VALIDATE_EMAIL nor the preg_match

PHPMailer - class.phpmailer.php - line 550:

public static function ValidateAddress($address) { if (function_exists('filter_var')) { //Introduced in PHP 5.2 if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) { return false; } else { return true; } } else { return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~][email protected](?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address); } }

Why is that possible?? does anyone have any idea what is going on??? why this email "[email protected]" is not allow?

-------------Problems Reply------------

my problem is when I use this email-string "[email protected]" within $mail->SetFrom()

I don't know why that specific address is being rejected and others aren't, but generally, you need to specify not only a valid E-Mail address as the from address, but one that is handled on the mail server you're sending the message from.

Otherwise, either the sending server is going to deny sending, or the receiving server is very likely to throw away the message as spam.

The usual policy is to specify [email protected] ( being your website domain). On some servers, you need to actually set up that address to be allowed to send mail from it.

Category:php Views:1 Time:2011-10-17
Tags: php phpmailer

Related post

  • Search button behaving oddly 2012-01-26

    I have a button on a form that has been working find, but for some reason it has decided to behave oddly. The button has the following "On Event" code: Private Sub btnFind_Click() [LastName].SetFocus SendKeys "%HS", False SendKeys "%N", False RunComm

  • Why are my lefthand navigation links behaving oddly in IE9 only? 2011-12-17 On this website, .. my lefthand navigation links are displaying & behaving perfectly in the following browsers (on the PC platform): Firefox 8.x Safari 5.x Chrome 16.x Opera 11.x IE 7 IE 8 However -- when you mo

  • Vista UltimateDevice Manager fails/behaves oddly 2013-01-27

    I have Windows Vista Ultimate (32 bit) installed. It was working fine until 4 days ago. Since the last time I used it and iut functioned correctly, NO NEW programs or devices have been added or settings modified. NOW I am encountering a problem that

  • Jquery selectors behave oddly 2009-12-03

    In my html page, I wrote: $('div > input').click(function(){ alert(1); }); my div is like this: <div id="CPE202" class="course"> <input type="checkbox" name="core" value="core" /> Microprocessor programming <input type="radio" name=

  • Linux Performance Stats Behaving Oddly 2010-09-21

    I'm using the linux /proc//stat file to generate cpu usage information for an application. The issue that I have run into is that on Fedora 13 things seem to act strangely whlie on ubuntu 10.04 things behave as I expect them to. Specifically: on fedo

  • Why does replaceChild() behave oddly when replacing one kind of element with another? 2011-01-05

    I am relatively new at javascript, and found an interesting behavior that I can't explain today. I have a custom <hr> (with an image) on a website, which displays oddly in IE7 and below. To overcome this, I wanted to use replaceChild() in combi

  • PreparedStatement.setString() call behaving oddly 2011-03-14

    This might be really simple, but I do not understand what is going wrong. As background, I use PreparedStatements with template queries for efficiency. I invoke setString(index, argument) to populate portions of the template, and after all fields are

  • LINQ join behaving oddly 2011-07-29

    I am attempting to perform a join between two tables and limit results by 3 conditions. 2 of the conditions belong to the primary table, the third condition belongs to the secondary table. Here is the query I'm attempting: var articles = (from articl

  • belongs_to with :class_name behaving odd 2011-08-07

    I have a Task model and User model. A task can be assigned a user to process it, while a user can be assigned many tasks. The field names are a little off so I am trying to use the class_name options etc, but for whatever reason I'm getting some odd

  • My CCScene is behaving oddly? 2011-11-17

    In my application I am noticing that there are may things that don't seem right in my CCScene. Ill just explain 3 things: 1. My FPS does not show anywhere in the view even though I do this from my UIViewController (My CCLayer is its own class) The .h

  • Clearcase config spec behaves odd when using setcs command 2011-12-22

    I have config spec stored in a text file . Following are the content element * CHECKEDOUT element ...\lost+found\... -none element \My\... MYF_R2. element \My\... My_2. element \My\... MyComponents_8_8_2011.6859 element \My\... M

  • is behaving odd this last 2 days. The Google Picture and the search box appear but all the other links don't appear straight away and when they do they look odd compared to my other PC. 2014-01-26

    Running IE8, Basically I get the google picture and the large search box as well as the text "this space intentionally left blank" BUT none of the other links show such as " i-google, search settings, sign in, images, videos, maps, news, shopping, ma

  • DllMain behaves oddly with g++ on Cygwin 2014-06-25

    I'm using gcc v4.8.3 on Cygwin. I'm unsure how DllMain() is supposed to behave in this context. When I compile the same code with mingw, it works as expected, and I get the output: Hello from DllMain Hello from main I'm a _WIN32 I'm a __MINGW32__ I'm

  • MSE Reappears and Behaves Oddly after Being Uninstalled for Months 2014-10-18

    This is odd. I am running Windows 7 Ultimate 64-bit, and originally installed Microsoft Security Essentials when I was first setting up the machine. Roughly four months ago, I uninstalled MSE and installed CA Antivirus Plus instead (because my client

  • PHP's json_decode() behaving oddly 2009-01-21

    I have two similar JSON files. I can read one of them with json_decode(), but not the other. I've uploaded the files to If you would like to check them, brother_a.php is working, while brother.php is not. I don't t

  • sharepoint custom theme behaving oddly 2009-07-16

    I'm deploying a sharepoint theme as a feature. the theme contains my css and images etc. when i deploy the theme and activate it it doesnt work. i accidently got the theme to work by opening up the masterpage i created in sharepoint designer checking

  • logical OR and modulus operator behaving oddly in Java 2010-02-24

    I'm trying to build an array of prime numbers in Java. if(c % 2 != 0 || c % 3 != 0 || c % 5 != 0) { n.add(c); } But my program seems to ignore the condition and just adds every number to my list. But if I just use one condition for example, if(c % 2

  • UITouch object behaving oddly 2010-05-13

    I wanted to get points where user is touching on the screen therefore I wrote following code which will fire when user will touch somewhere on the screen -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches wi

  • Variables Behaving Oddly (Intel 8086) 2010-07-19

    Edit: Answered my own question. See below. -_- I have a variable defined in the .data segment as follows: retVal DW 0100h ;stores hex fraction of the intermediate value. Starts at 1.00 This is the value that I add or subtract to to get my return valu

Copyright (C), All Rights Reserved.

processed in 0.172 (s). 11 q(s)