Wednesday, 23 February 2011

how to use your own internet outgoing mail server (smtp), as your provider doesn't allow you to use it

situation
Many providers doesn't allow you to send emails from your company's internet outgoing mail server (smtp), for instance: mail.mycompany.com. The provided reason by the provider is that if you use their connection for spam activities, even if using different outgoing server, provider's ip address will be marked as spam and will be banned in future from other internet servers. The only way is to use the smtp provided by your provider... and this the most easy solution.

problem
In case you use laptop and change several network places (aka providers), you cannot use the provider's smtp... but your company's smtp. So... how to get connected with smtp via your problematic provider???

solution
You must change the tcpip port connection with your smtp.
Of course this change must be done together on smtp and on your client. But some servers doesn't have this setting or even worst this change must be made to all clients that use this smtp server, that means to all employees of the company! forget it!

Take a deep breath... the easiest way to do this... is to turn the client to connect with smtp server with SSL connection. The SSL communicates in different port that is not blocked by your provider... so the steps are...

1. ask from your server administrator... the "outgoing smtp sll tcpip port". this number could be 465 or 567 or 587 or what ever

1.1 if you are the administrator :), see the cpanel (or what ever panel) help about how to configure the email clients. there you will find the port number that is already activate for the smtp ssl connection.

the follow instructions are for msoffice2007/2010, do accordingly on your client

2. file -> accounts settings -> select the email account you want to change -> press the "change" button -> more settings -> outgoing server

3. here, check the required authentication and if the username and password are diffferent from the incoming server, check you use them and type them

4. goto to "advanced" tab



5. here, as "outgoing SMTP" enter the port where administrator told you, 465 or what ever

6. also, as "encrypted connection" select "SSL"


7. now... the most complex part is here... on first email send process, the client will request certification from the server, and you have to accept it. Agree with the follow messages will appeared and the certification will be stored in your computer for the future outgoings.


These settings of outgoing connection, you may apply them in all of your problematic accounts.

Sunday, 20 February 2011

Flex, how to make the cursor handpoint


Make the mouse Handpoint over Image component
this technique, show the mouse point handpoint on images

public function Handle_SelectMag_MouseOver(event:MouseEvent):void {
Image(event.target.parent).buttonMode=true;
Image(event.target.parent).useHandCursor=true;
}
public function Handle_SelectMag_MouseOut(event:MouseEvent):void {
Image(event.target.parent).buttonMode=false;
Image(event.target.parent).useHandCursor=false;
}

in general...how to make handpoint on a visual component
--- make it handpoint (on mouseOver event)
buttonMode=true;
useHandCursor=true;

--- make it normal (on mouseOver event)
buttonMode=false;
useHandCursor=false;

Flex4, image component, how to get dimensions of a Image... actual size, applied size etc


problem:
Searching at internet I didn’t find a correct distinction about the available values about the dimensions that Image component gives. Adobe's reference help of course has complete definition of these propoerties... but lets summarize them.

solution definition:
--- Image.width, Image.height
this is the width and height of the component that shows the image
--- Image.measuredWidth, Image.measuredHeight 
these are the actual dimensions of the Image, irregardless the previous dimensions and if the image is scaled
--- Image.contentWidth, Image.contentHeight
these are the dimensions that image have now at the Image component, dimensions as scaled image

Further problem… Many values are returned as 0 zero or NaN
When you assign data to “data” property… the Image component doesn’t do all the do job it must do… you have to give it some time to complete all it's the pending issues… 

Solution... 
EVENT!!! Wait for the event Image’s event “updateComplete” and there… check again if the width property (you want) is NaN or not, using the isNaN function.

The event handler will look like this:

  internal function Handel_imPhoto_updateCompleted(e:Event):void{
                  if (!isNaN(im_photo.measuredHeight))
                          height= im_photo.measuredHeight;
           }

Thursday, 17 February 2011

Flex4, how to use mx:TextArea and mx:RichTextArea in Spark world

situation
With new spark components, some old ms components are not implemented yet in spark version, or are exist and it is complex in use.

benefits
with this ms version of these two components, you allow the user to use a nice editor with format text abilities, and represent this formated text (it is html encoded) using only one property, the htmltext.
Till now in Flex 4 and Spark we have no these two power and easy to use components, we hope Adobe to be reasonable and to do not downgrade us more!

problem
how to add mx:TextArea and mx:RichTextArea in spark application? the mx complents doesn't exist in components pallete

solution
open the mxml source code... and insert the two follow lines.
    <mx:RichTextEditor x="0" y="50" width="400" height="200"/>
    <mx:TextArea x="0" y="210" width="400" height="100" />
these lines are creating the RichTextArea and TextArea on you design place.