Saturday, October 10, 2009

How to dial a dial-up connection on windows startup

It is a headache to dial a dial-up connection each time we start windows to surf internet. Is there any way that we can dial a dial-up connection automatically when windows starts?

The answer is yes..

1. First go to Control Panel > Network Connections

Then right click on the connection that should be dialed automatically and click on Create Shortcut from the pop-up menu. Then click yes when you asked to create the shortcut on desktop.



2. Again Right-click on the connection and click on properties. In properties dialog go to Options tab. In Dialing Options pane uncheck all options as shown in the figure.




3. Copy shortcut created in step 1 which is in the Desktop to the Startup in Start menu.




Now you are done.. Try restarting the computer.. When are login the connection should be made already..


Tuesday, January 29, 2008

Marked as spam while sending emails using php mail() function to yahoo or hotmail?

It is a common problem for all using php mail function. To solve this there
are so many answers I have seen in the internet and they do not hit problem
correctly.

Actually the problem here is if we send mails using php mail function we do
not have a signature and other mailing systems thinks that we are spamers.


So the solution is using a free remote smtp host like gmail to send our mails.
It is not hard because we have a free php smtp project called PHPMailer. You
can download it from here.
You do not need to install it on your server. Just you have to upload it with your code.


It is very easy to understand how it is used to send mails using examples
zipped with PHPMailer. The following code is to send emails using gmail and
to do that you have to have a gmail mail account. Which can easily be created
by visiting http://gmail.com. Your mails will
send using that mail account and they will never become spams...




<?php


// example on using PHPMailer with GMAIL


include("class.phpmailer.php");

include("class.smtp.php");


$mail=new PHPMailer();


$mail->IsSMTP();

$mail->SMTPAuth = true; // enable SMTP authentication

$mail->SMTPSecure = "ssl"; // sets the prefix to the servier

$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server

$mail->Port = 465; // set the SMTP port


$mail->Username = "yourname@gmail.com"; // GMAIL username

$mail->Password = "password"; // GMAIL password


$mail->From = "replyto@yourdomain.com";

$mail->FromName = "Webmaster";

$mail->Subject = "This is the subject";

$mail->Body = "Hi,<br>This is the HTML BODY<br>"; //HTML
Body

$mail->AltBody = "This is the body when user views in plain text format";
//Text Body


$mail->WordWrap = 50; // set word wrap


$mail->AddAddress("username@domain.com","First Last");

$mail->AddReplyTo("replyto@yourdomain.com","Webmaster");

$mail->AddAttachment("/path/to/file.zip"); // attachment

$mail->AddAttachment("/path/to/image.jpg", "new.jpg");
// attachment


$mail->IsHTML(true); // send as HTML


if(!$mail->Send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message has been sent";

}



Wednesday, August 8, 2007

How to remove all adds put in a free web hosting site using a simple JavaScript

All sites that hosts web sites for free (Such as 50megs.com), puts their adds on our html pages. So what can we do for avoid these adds. In one side you can by a hosting plan paying money. But I am going to tell you the other way. That is hide all the adds that were not put by us.
To do second method, first you should create your site inside a div tag which has id of "keepThis" as following

<div id="keepThis">Here put your code for the page</div>


Then you should put onLoad event on body tag as following..

<body background="../bg.jpg" onLoad="killAll()">

Then put following JavaScript to header section of your page.

<script language="JavaScript">



function handleError(msg,url,num)
{
return true;
}

window.onerror = handleError;



function killAll()
{
var allEles = document.getElementsByTagName('*');
for(var i=0; i {
if(allEles[i].style["visibility"]!=undefined)
{
if (isDel(allEles[i])==true)
{
allEles[i].style["visibility"]="hidden";
}
}
}
var w = document.body.clientWidth;
w=(w-685)/2;
var ele = document.getElementById("keepThis");
ele.style['left'] = w;
}
function isDel(ele)
{
var rtn = true;
if((ele.nodeName==undefined)||(ele.nodeName==undefined)||(ele.id==undefined))
return false;

if((ele.nodeName.toUpperCase()=="BODY")||(ele.nodeName.toUpperCase()=="HTML")||(ele.nodeName.toUpperCase()=="HEAD")||(ele.nodeName.toUpperCase()=="SCRIPT")||(ele.nodeName.toUpperCase()=="META"))
return false;

while(ele)
{
if (ele.id=="keepThis")
{
rtn=false;
break;
}
if (ele.nodeName!=undefined)
ele=ele.parentNode;
else
break;
}
return rtn;
}


</script>



Hey you're done now. You can host your page without any forced adds on a free web server.