Support for 8bit, base64, binary, and quoted-printable encoding.
Word wrap.
Multiple fs, string, and binary attachments (those from database, string, etc).
SMTP authentication.
Tested on multiple SMTP servers: Sendmail, qmail, Postfix, Gmail, Imail, Exchange, etc.
Good documentation, many examples included in download.
It's swift, small, and simple.
[http://phpmailer.codeworxtech.com]
How to use
Download PHPMailer from http://sourceforge.net/projects/PHPmailer
Extract it into your web directory.
Turn on SSL support.
Use the following code to send email.
Sample code include("/lib/phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); // Creating PHPMailer object $body = "Hai hello, this is my first mail using PHPMailer. "; $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "ssl://smtp.gmail.com:465"; // SMTP Server.
/*
Setting gmail as the SMTP Server
*/ $mail->Username = "myphpapp@gmail.com"; // username [Gmail] $mail->Password = "mypassword"; // password for myphpapp $mail->AltBody = "This is the body when user views in plain text format"; $mail->Subject = "Say hello!"; // This is the subject $mail->From = "myphpapp@gmail.com"; // From email-id $mail->FromName = "PHP Developer"; // From Name $mail->MsgHTML($body); $mail->AddAddress("toaddress@gmail.com","Name"); // To address. $mail->IsHTML(true);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
else {
echo "Message has been sent";
} ?>
File Upload control doesn't have an event associated with it to post a file to server, so add button a to the page
2. Create a database in SQLSEVER to store your image for example lets create a table named 'employee' where we store Employee's image with other relevant information.
Employee table contains the following fields:
EmployeeidInt,
Employeename Varchar(50),
EmpImgImage. (look here the datatype is image/blob).
3.Add Generic Handler
Generic Handler file is an asp.net file with ashx extension similar to a normal web file with aspx extension. Normal aspx pages is used to handle"light duties" .But the ashx files can handle ‘Heavy duty’ like dynamically loadingpictures from database .
Just as aspx files can be compiled on the fly (just-in-time), so can be handlers. Generic handlers have an extension of ashx. They're equivalent to custom handlers written in C Sharp or Visual Basic.NET in that they contain classes that fully implement IHttpHandler. They're convenient in the same way as of aspx files. You simply surf to them and they're compiled automatically.
The following example illustrates the implementation of a "generic handler". Here the name given is GetImage.
Add a "generic" handler to the Web site. Go to the Solution Explorer, right-click on the CustomHandler Web site node and select Add New Item. Select Generic Handler from the templates. Name the handler GetImage.ashx:
Generic Handler Code GetImage.ashx is given below.
<%@ WebHandler Language="C#" Class="GetImage" %>
using System;
using System.Web;
using System.Data.SqlClient;
using System.IO;
public class GetImage : IHttpHandler {
public void ProcessRequest (HttpContext context) {
try
{
string empno;
if (context.Request.QueryString["id"] != null)
empno = context.Request.QueryString["id"].ToString();//Get Employee Id from Query String
else
throw new ArgumentException("No parameter specified");
context.Response.ContentType = "image/jpeg";
Stream strm = GetImageData(empno);
byte[] buffer = new byte[4096];
int byteSeq = strm.Read(buffer, 0, 4096);//Read Image data from Db to byte array
Download Aptana Studio 1.2.6 Inlcudes Aptana Cloud & Jaxer. Add support for PHP, Ruby, Rails, Python, iPhone and Adobe AIR after installation.
Since Aptana Studio is based on Eclipse, I can take advantage of the vast number of Eclipse plugins like Mylyn, the Bazaar plugin, GotoFile, QuantumDB, SQL Explorer, etc... Download
A Gantt chart(wiki link) is a type of bar chart that illustrates a project schedule. Gantt charts illustrate the starting and finishing dates of terminal elements and summary elements of a project. Terminal elements and summary elements comprise the work breakdown structure of the project. Some Gantt charts also show the dependency (i.e, precedence network) relationships between activities.
We here use jsgantt(Its a free JavaScript library for creating Gantt chart) to create Gantt chart having following features .It’s implemented using JavaScript, HTML, CSS and thus very fast and flexible. Since it is pure HTML/JavaScript you can integrate this with any server side scripting language.
There are many ways to integrate gantt chart programmatically, here we explain one of the method which using external data exchange between asp.net and JavaScript using XML file that are generated at run time using values from the SQL Server Database.
Sample xml file Structure that used by jsgantt. Is as follows
<project>
<task>
<pID>10</pID>
<pName>WCF Changes</pName>
<pStart></pStart>
<pEnd></pEnd>
<pColor>0000ff</pColor>
<pLink></pLink>
<pMile>0</pMile>
<pRes></pRes>
<pComp>0</pComp>
<pGroup>1</pGroup>
<pParent>0</pParent>
<pOpen>1</pOpen>
<pDepend />
</task>
<task>
<pID>20</pID>
<pName>Move to WCF from remoting</pName>
<pStart>8/11/2008</pStart>
<pEnd>8/15/2008</pEnd>
<pColor>0000ff</pColor>
<pLink></pLink>
<pMile>0</pMile>
<pRes>Rich</pRes>
<pComp>10</pComp>
<pGroup>0</pGroup>
<pParent>10</pParent>
<pOpen>1</pOpen>
<pDepend></pDepend>
</task>
</project>
XML tags in our External XML file have following tags and values. Here we describe the purpose of each tag:
pID: (required) is a unique ID used to identify each row for parent functions and for setting dom id for hiding/showing
pName: (required) is the task Label
pStart: (required) the task start date, can enter empty date ('') for groups
pEnd: (required) the task end date, can enter empty date ('') for groups
pColor: (required) the html color for this task; e.g. '00ff00'
pLink: (optional) any http link navigated to when task bar is clicked.
pMile:(optional) represent a milestone
pRes: (optional) resource name
pComp: (required) completion percent
pGroup: (optional) indicates whether this is a group(parent) - 0=NOT Parent; 1=IS Parent
pParent: (required) identifies a parent pID, this causes this task to be a child of identified task
pOpen: can be initially set to close folder when chart is first drawn
pDepend: optional list of id's this task is dependent on ... line drawn from dependent to this item
pCaption: optional caption that will be added after task bar if Caption Type set to "Caption"
Creating Database Schema in Sql Server
Create database named Projects in SQL Server
Tables
project
Column Name --------------------------------Data Type
SqlConnection mcon = newSqlConnection("Data Source=CYBERMIND\\SQLEXPRESS;Database=Projects;Trusted_Connection=True"); //Cahnge Connection string of your SQL Server Here
mcon.Open();
cmbproject.Items.Clear();
SqlCommand GetProjectName = newSqlCommand("select projectid,name from project", mcon);
SqlDataReader ReadPrjName;
ReadPrjName = GetProjectName.ExecuteReader();
cmbproject.Items.Add("--------Select-----");
while (ReadPrjName.Read())
{
ListItem LIT = newListItem();
LIT.Text = ReadPrjName.GetValue(1).ToString();//Add Project name as dropdownlists Text
LIT.Value = ReadPrjName.GetValue(0).ToString();//Add Projectid asdropdownlists Value