Archive for the ‘Programming’ category

Send Email from a PHP Script Using SMTP Authentication

March 30th, 2011

This post about “Sending Mail using SMTP and PHP“. Now you can send emails with SMTP authentication using this script. Every mail needed server authentication, So you have to buy mail server. It’s very useful you can implement this on your web projects.

This tutorial contains three files.

- Index.php //Run Mail Form
- SMTPconfig.php // SMTP Server Cofiguration
- SMTPClass.php // SMTP Mail Sending Class

SMTPconfig.php
You have to change SMTP server details.

<?php
//Server Address

$SmtpServer=”127.0.0.1″;
$SmtpPort=”25″; //default
$SmtpUser=”username”;
$SmtpPass=”password”;
?>

 

SMTPclass.php
SMTP mail sending class.

<?php

class SMTPClient
{

function SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body)
{

$this->SmtpServer = $SmtpServer;
$this->SmtpUser = base64_encode ($SmtpUser);
$this->SmtpPass = base64_encode ($SmtpPass);
$this->from = $from;
$this->to = $to;
$this->subject = $subject;
$this->body = $body;

if ($SmtpPort == “”)
{
$this->PortSMTP = 25;
}

else

{
$this->PortSMTP = $SmtpPort;
}
}

function SendMail ()
{
if ($SMTPIN = fsockopen ($this->SmtpServer, $this->PortSMTP))
{
fputs ($SMTPIN, “EHLO “.$HTTP_HOST.”\r\n”);
$talk["hello"] = fgets ( $SMTPIN, 1024 );
fputs($SMTPIN, “auth login\r\n”);
$talk["res"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpUser.”\r\n”);
$talk["user"]=fgets($SMTPIN,1024);
fputs($SMTPIN, $this->SmtpPass.”\r\n”);
$talk["pass"]=fgets($SMTPIN,256);
fputs ($SMTPIN, “MAIL FROM: <”.$this->from.”>\r\n”);
$talk["From"] = fgets ( $SMTPIN, 1024 );
fputs ($SMTPIN, “RCPT TO: <”.$this->to.”>\r\n”);
$talk["To"] = fgets ($SMTPIN, 1024);
fputs($SMTPIN, “DATA\r\n”);
$talk["data"]=fgets( $SMTPIN,1024 );
fputs($SMTPIN, “To: <”.$this->to.”>\r\nFrom: <”.$this->from.”>\r\nSubject:”.$this->subject.”\r\n\r\n\r\n”.$this->body.”\r\n.\r\n”);
$talk["send"]=fgets($SMTPIN,256);
//CLOSE CONNECTION AND EXIT …
fputs ($SMTPIN, “QUIT\r\n”);
fclose($SMTPIN);

//

}
return $talk;
}
}
?>

 

index.php

<?php

include(‘SMTPconfig.php’);
include(‘SMTPClass.php’);
if($_SERVER["REQUEST_METHOD"] == “POST”)
{
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['sub'];
$body = $_POST['message'];
$SMTPMail = new SMTPClient ($SmtpServer, $SmtpPort, $SmtpUser, $SmtpPass, $from, $to, $subject, $body);
$SMTPChat = $SMTPMail->SendMail();
}

?>
<form method=”post” action=”">

To:<input type=”text” name=”to” />
From :<input type=’text’ name=”from” />
Subject :<input type=’text’ name=”sub” />
Message :<textarea name=”message”></textarea>
<input type=”submit” value=” Send ” />
</form>

 

Download Source Code

 

10 web site designing mistakes.

February 18th, 2011

Today it takes more than just having a Web site to make the Internet work for your company. Sites are highly competitive, and proper site design has become an area of concern to businesses that want to use the Internet to the fullest. Below are 10 common Web site errors that occur.

  1. Inappropriate domain name: Pick a domain name that is memorable and relates to your business. Since people are likely to forget very long names, shorter domain names are typically better, but not always. For example, a name like Peter.com can be too vague and says nothing about the content of the Web site.
  2. Poor design and functionality: Why have a Web site with content if no one can access it? Good design is largely based on consistency. Menus should appear in the same place on every page, links should all be the same color/typeface, and a logo of some sort should be clearly visible at all times.
  3. Too complicated or too slow: Although flash animation may look amazing, it may be too complex for casual Internet users. Though aesthetics certainly matter, it must be in balance with functionality and ease of use for the typical user. Also, a more complex design takes longer to load on many computers.
  4. Stagnant site: Not only is content time-sensitive, so is format and design. There will always be new tools available to make Web sites better looking and better performing. It is not cost-effective to create a Web site and let it sit. Update content regularly and take advantage of (appropriate) new technologies to make the site look better.
  5. Broken links and 404 error messages: Make sure every link on your site works. You’ll lose users quickly if they see a “404 file not found” error message or find broken or incorrectly labeled links. If you have a large site, consider adding a form so users can submit a broken link, which lets users know you are on top of any problems they discover.
  6. No contact info: Users need to be able to contact you with questions, complaints, and suggestions. A Contact Us page, like an Internet business card, should be available from any part of your site. Also, be sure to actually answer these messages either personally or through an auto-reply.
  7. Ignoring statistics: Detailed reports of visitor traffic are available for your Web site. This service may be offered by your hosting provider or obtained through a third party. By monitoring your statistics (such as visitors-turned-customers, users on broadband, etc.) you can tailor your marketing and design toward those who visit most or find weak spots based on who you are not attracting.
  8. Free or cheap hosting: As attractive as some of these services are, realize that the reliability of your business depends on the reliability of your hosting. A good host service should have minimal downtime, offer services such as shopping cart systems, and have good customer support. Be sure to read reviews and apply for free trials (if possible) before you commit to anything.
  9. Avoiding spiders: Spiders are what search engines use to find your page. You want to make sure your pages are designed so that you show up high on search engine rankings. This process is called search engine optimization. There are, however, ethics and strategies to SEO. Some practices (such as hidden text, redirects, etc.) will result in you being banned from search engines.
  10. Not hiring a professional: Search engine optimization is complex. To move up in the listings on Google and other search engines, you may want to hire a professional, especially if your business relies heavily on generating business from the Web.

For more visit: www.version-next.com

Search Engine Optimization (SEO)

April 21st, 2010
web site optimization services india

Search engine optimization’s goal is to maximize your organization’s online business. It has direct relation to your popularity, sales, profits, and growth in number of customers.

Technologus is a leading Search Engine Optimization company that offers you professional and guaranteed search engine optimization services at the most affordable prices.

Our optimization specialists workout the best strategy for your company’s website to ensure high rankings in all major search engines like Google, Yahoo, and Msn etc.

We know that a combination of page optimization and a well implemented link popularity campaign is essential for your website. Therefore, we adopt a high-end search engine optimization program and submit your site to all the top search engines on the Internet. Our continuous and rigorous promotional campaign for your site results in high traffic from both related sites and search engines.

Many professional Search engine optimization companies initially offer you great packages but then leave in you the middle of the pack. What makes us different is that we are committed and work closely with you to help you achieve your goals of increasing your business.

Taking care of your online business is our business. We develop Internet marketing strategies like search engine submission, search engine optimization, and link popularity services to take your website on the “top of the pack” in the relevant search results of all major search sites.

We believe in long-term relationships with our customers and are committed to provide you with value for money services.

The bottom line is that your success is our success and success is a habit with us.

What are some of the basic steps to Optimizing your web site?

April 19th, 2010

1.  Meta Research!!!!  The keywords used to describe your web site will be thoroughly researched to insure that you are using the right words – meta tags should contain 10 to 15 of the carefully selected key words and phrases for each page you are submitting to the search engines.

2.  Meta Rich Content! Each page should contain approximately 2,000 words describing your service/product.  We will enrich your text to include the keywords and phrases insuring they are used a minimum of 5% of the content.

3.  Page Techniques: In order to prove to the search engine spiders that your web site is relevant to the meta tags you’ve submitted, several techniques will be applied to your pages.  The quality graphics that make your page visually appealing will not only interest & entice the visitors, but they will entice the search engines after they are encoded with alternate image tags. Heading tags made up of your keywords/phrases will be added to your content.

4.  Doorway/Content Pages: These keyword/key phrase specific optimized pages are designed to rank well with the Search Engines. The goal of doorway pages is utilizing more valuable content within the crawlable pages of a Web site. The idea is to create the page that looks as if it is the main entry page of your web site, but the doorway page only features a particular type of product or service.  It is richly designed with graphics valuable information and an irresistible sales pitch.  It must make high usage of the keywords and key phrases.  It will serve as an introduction to your product/services and thereby entice the visitor to continue viewing your other products & services from text links at the bottom of the page.

Startegic SEO & Linkbuilding

April 19th, 2010

You own a great website with a beautiful design but lost hope due to low web traffic and low search engine ranking? A bright glow of hope from our website can again light up your spirits. Are you in search of the perfect professional service that could take your website scale up the heights of search engine rankings? Before being totally desperate, take a moment to tour our website.

HandsomeSEO have the Right choice and complete solution for all your SEO concerns. SEO Services like Site Optimization, Link Building, Directory Submission and lots more are carefully designed keeping in mind the unique needs of our customers. we, will increase your Sites’s Traffic by improving your website’s search engine rankings through our time tested link-building services.

Building unlimited links is not what one understand from Effective Link Building but it means getting genuine links from website which are reliable. While talking about Link Building one want to ask it’s Benefits ?

Benefits of Link building:

  • More visibility of your website/blog in search result.
  • High quality incoming link means your site will be admired as a valuable resource. This could be easily done by writing quality content.
  • Link building also helps in getting indexed in search result easily.
  • Link building is also considered as an important aspect of SEO.
  • Helps you to receive traffic from other websites linked to you.

A professional’s service is an unavoidable event in the confusing, bewildering or say puzzling  world of Search Engine Optimization. When you are in the need of the premium best quality professional to direct you, then do not waffle another second and choose us, the HandsomeSEO. You can enjoy the comfort, a proper solace of your mind by believing us with all your SEO needs.

PHP Freelancer