0% found this document useful (0 votes)
6 views

PHP PROJECT by fvxhjjvbs,vjksbzhjkc,

The document outlines a micro project completed by a group of four students from Government Polytechnic, Jalgaon, focusing on sending emails with attachments using PHP. It includes sections on SMTP fundamentals, project methodology, advantages and disadvantages of email attachments, and concludes with a successful implementation of the project. The project was guided by Mr. S. S. Bhosale and acknowledges support from faculty and family.

Uploaded by

lihofe4607
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

PHP PROJECT by fvxhjjvbs,vjksbzhjkc,

The document outlines a micro project completed by a group of four students from Government Polytechnic, Jalgaon, focusing on sending emails with attachments using PHP. It includes sections on SMTP fundamentals, project methodology, advantages and disadvantages of email attachments, and concludes with a successful implementation of the project. The project was guided by Mr. S. S. Bhosale and acknowledges support from faculty and family.

Uploaded by

lihofe4607
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

MAHARASHTRA STATE BOARD OF TECHNICAL

EDUCATION

GOVERNMENT POLYTECHNIC, JALGAON

(0018)

Program Name and Code: Information Technology (IF6I)


Course Name and Code: Web Based Application
Development Using PHP (22619)
Academic Year: 2020-21
Semester: Sixth
A MICRO PROJECT
ON
Sending E-Mail with Attachment
Submitted by the group of 4 students

Roll No. Name Enrollment No Seat No


5 Mahendra Ramesh Talele 1700180170
14 Harshada Virendra Chaudhari 1800180194
35 Yash Vilas Somani 1800180221
67 Aniket Arun Shinde 1800180604
Guided By
Mr. S. S. Bhosale
(Lecturer in IT)
1
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION
Certificate
This is to certify that Mahendra Talele, Harshada Chaudhari, Yash
Somani, Aniket Shinde Roll No. 5, 14, 35, 67 of 6th Semester of Diploma
in Information Technology of Institute, Government Polytechnic,
Jalgaon (Code:0018) has completed the Micro Project satisfactorily in
the subject Web Based Application Development Using PHP (22619)
for the Academic Year 2020- 2021 as prescribed in the curriculum.
Place: Jalgaon Enrollment No: 1700180170,
1800180194,
1800180221,
1800180604
Date: __/__/____ Exam. Seat No:

Subject Teacher Head of the Department Principal

Seal of
Institutio
n

2
GOVTERNMENT POLYTECHNIC
JALGAON

SUBMISSION
We Mahendra Talele, Harshada Chaudhari, Yash Somani, Aniket
Shinde as a students of 6th Sem 3rd Year of the Programme Information
Technology humbly submit that we have completed from time to time the
Micro-Project work as described in this report by our own skills and study
between the period from 2020 -2021 as per guidance of Mr. S. S. Bhosale
Sir.
And that following students were associated with me for this work;
however, quantum of my contribution has been approved by the Lecturer.
And that I have not copied the report on its any appreciable part from any
other literature in contravention of the academic ethics.
Place: Signature of Students
Date: 1)
2)
3)
4)

3
ACKNOWLEDGEMENT
This Micro project would not have been possible without
considerable guidance and support. So, we would like to acknowledge
those who have enable us to complete this project.
Firstly, we would like to thank our project guide, Mr. S. S. Bhosale
(Lecturer in IT, Government Polytechnic, Jalgaon) and HOD Dr. S.
D. Patil for providing the guideline with continuous advice and feedback
throughout the duration of finishing this project. We also thank to the Dr.
A. B. Wesly (Principal, Government Polytechnic, Jalgaon) for
providing us the opportunity to embark on this project
Secondly, we would also like to thank all other staff members of IT
department that we may called upon for assistance since the genesis of
this project their opinion and suggestion have helped us in a realizing this
project.
Also, not to be forgotten, we would like to thank all our friends with the
report valuable opinion and sharing ideas during the process of this project
Finally, we would like to thank our families for their understanding,
encouragement and support towards the completion of project.
Thank so much.

4
Index
Sr No Title Page No
1 Introduction 6 to 8

2 SMTP and SMTP Fundamentals 9

3 SMTP Protocol 10

4 How to Project Work 11

5 Flowchart 12

6 Requirement 13

7 Output 14 to 15

8 Advantages and Disadvantages 16

9 Features 17

10 Application 18 to 19

11 Conclusion 20

12 References 21

5
Introduction
Sending emails from the script is a very useful functionality in the web application.
Most of the websites used the email sending feature to send notifications to the user.
If your web application developed with PHP or uses PHP, it’s very easy to send
email from the script using PHP.

PHP provides an easy way to send emails from the website. You can send text or
HTML email with mail() function in PHP. But sometimes email functionality needs
to be extended for sending an attachment with the mail. In this tutorial, we will show
you how to send email with attachment in PHP.

In the example script, we will make it simple to send text or HTML email including
any types of files as an attachment (like image, .doc, .docx, .pdf, .txt, etc.) using
PHP.

➢ Send HTML Email with Attachment

The PHP mail () function with some MIME type headers can be used to send email
with attachment in PHP. In the following example code, MIME and Content-Type
headers are used with mail () function to send email with attachment using PHP.
• $to – Recipient email address.
• $from – Sender email address.
• $from Name – Sender name.
• $subject – Subject of the email.
• $file – Relative path of the file that you want to attach with the email.
• $HTML Content – Body content of the email (Text or HTML).

The following script lets you send both types of messages (text or HTML) with an
attachment file to the email.

6
➢ Send Attachment with Email

Sending an email is a very common activity in a web browser. For example, sending
an email when a new user joins to a network, sending a newsletter, sending greeting
mail, sending an invoice. We can use the built-in mail () function to send an email
programmatically. This function needs three required arguments that hold the
information about the recipient, subject of the message and message body. Along
with these three required arguments, there are two more arguments which are
optional. One of them is the header and the other one is parameters.
We have already discussed sending text-based emails in PHP in our previous article.
In this article, we will see how we can send an email with attachments using mail ()
function.
When the mail () function is called, PHP will attempt to send the mail immediately
to the recipient then it will return true upon successful delivery of the mail and false
if an error occurs.
Syntax:
bool mail ( $to, $subject, $message, $headers, $parameters );
Here is the description of each parameter.
Name Description Required/ Type
Optional
to This contains the receiver or Required String
receivers of the particular email
subject This contains the subject of the Required String
email. This parameter cannot
contain any newline characters.
message This contains the message be to Required String
sent. Each line should be separated
with a LF (\n). Lines should not
exceed 70 characters (We will use
word -wrap () function to achieve
this).
headers This contains additional headers, Optional String
like, from, Cc, mime Version, Bcc.
parameters Specifies an additional parameter to Optional String
the send mail program.

7
When we are sending a mail through PHP, all content in the message will be treated
as simple text only. If we put any HTML tag inside the message body, it will not be
formatted as HTML syntax. HTML tag will be displayed as simple text.
To format any HTML tag according to HTML syntax, we can specify the MIME
(Multipurpose Internet Mail Extension) version, content type and character set of the
message body. To send an attachment along with the email, we need to set
the Content-type as mixed/multipart and we have to define the text and attachment
sections within a Boundary.

8
Simple Mail Transfer Protocol (SMTP)
Email is emerging as one of the most valuable services on the internet today. Most
of the internet systems use SMTP as a method to transfer mail from one user to
another. SMTP is a push protocol and is used to send the mail whereas POP (post
office protocol) or IMAP (internet message access protocol) are used to retrieve
those mails at the receiver’s side.

• SMTP Fundamentals
SMTP is an application layer protocol. The client who wants to send the mail opens
a TCP connection to the SMTP server and then sends the mail across the connection.
The SMTP server is always on listening mode. As soon as it listens for a TCP
connection from any client, the SMTP process initiates a connection on that port
(25). After successfully establishing the TCP connection the client process sends the
mail instantly.

9
SMTP Protocol
The SMTP model is of two type:
1. End-to- end method
2. Store-and- forward method
The end-to-end model is used to communicate between different organizations
whereas the store and forward method are used within an organization. A SMTP
client who wants to send the mail will contact the destination’s host SMTP directly
in order to send the mail to the destination. The SMTP server will keep the mail to
itself until it is successfully copied to the receiver’s SMTP. The client SMTP is the
one which initiates the session let us call it as the client- SMTP and the server SMTP
is the one which responds to the session request and let us call it as receiver-SMTP.
The client- SMTP will start the session and the receiver SMTP will respond to the
request.

10
How to Project Work
1. Index.php file will open.
2. Then user need to enter required data.
3. Then he/she need to select file from the device.
4. If user need to change file name, then he needs to enter alterative name for file.
5. After filling all detail user will send email through the send email button.
6. If all entered detail are correct then email will send, otherwise it occurs error
and show message “Message could not be sent Mailer Error”.

11
Flowchart

12
Requirement
• Device (Which Support Internet and Web Browser)
• Internet
• Web Browser
• E-Mail Account

13
Output

14
15
Advantages and Disadvantages
• Advantages: -
1. Email attachments is easy way to send small files.
2. PowerPoint presentation, Word File, Pdf files, Picture, Video etc can be sent easily
by email.
3. Files can be transferred from one computer to another using email attachments.
4. No geographical barrier, files can be transferred from one country to another
country instantly.
5. For printing and scanning purpose files can be shared by email attachment.

• Disadvantages: -
1. Takes time to upload and download files or other attachments.
2. Large files cannot be sent by free email service.
3. Additional software is required to open specific file format.
4. Files may not be uploaded or downloaded properly from email if internet speed
is slow.

16
Features
• Email is a very popular way of communicating with others over the Internet.
• Each of the email client applications is designed to suit specific types of users so,
you can choose one with the features that best suits your particular needs.
• In order to attach file(s) to an email, click the attach button. As a result, a dialog
box appears asking for specifying the name and location of the file you want to
attach.
• Once you have selected the appropriate file, it is attached to the mail.
• Usually, a paper clip icon appears in the email which indicates that it has an
attachment.
• When adding an attachment, it is better to compress the attached files so as to
reduce the file size and save transmission time as sending and downloading large
files consumes a lot of space and

17
Application

• Speed of Delivery

One of the key benefits of email attachments in companies is the speed of delivery,
which ranges from a few seconds for smaller attachments to several minutes for
larger or multiple attachments. This may be faster than hand delivering a document
to an individual in another part of the office. Colleagues speaking on the phone or
participating in a conference call can share documents using email attachments and
discuss them during the call. There is no need to wait for delivery, or until all
workers are in the same place at the same time.

• Cost Savings

Email attachments can money. Besides allowing workers to be more efficient with
their time, which also has monetary value, email attachments reduce delivery costs.
Emailing documents as attachments removes the need to pay for postage when the
document is going outside the office. It also reduces the need for workers to
manage intra-office mail. Besides saving on delivery costs, email attachments that
don't require printing save paper, ink or toner costs. Skipping the printing process
also has a positive environmental impact.

• Data Record

Email attachments create a data record for those who send and receive them.
Whether they are from an office email system or personal email host, email servers
store old attachments until a user's mailbox reaches its data limit. These limits are
generally high, and allow for hundreds or thousands of stored emails and
attachments. Lost documents are easy to replace, and older versions of documents
remain archived for reference. This occurs automatically whenever workers share
information using email attachments.

• Availability and Security

Workers who use email attachments have access to their documents and responses
24 hours a day. If they use conventional email hosts, they can view attachments at
home or on a mobile device from a remote location. Unlike file transfer protocols,
which require more complex authentication procedures and may only recognize
office computers, email attachments are readily available when workers need them.

18
Automated email virus scanning and antivirus software ensures that companies can
share email attachments without compromising security.

• Faster Communication

Email is a faster means of communication and correspondence. With email,


business people are not held up by delays commonly experienced when sending
correspondence in the mail. Additionally, emailing documents is faster than faxing.
In just a click of a button, businesses can send time-sensitive information to anyone
in the world and the recipient gets the message almost instantaneously. This type
of fast, effective exchange allows people to stay on top of projects, respond to
communication requests with more efficiency and be more productive.

• More Accessibility

Email eliminates time and global barriers. When business people use email they
can send and receive information at any hour, day or night. Since email is Internet-
based, advanced communication technology makes it possible for individuals to
access email from anywhere in the world, via an Internet connection from their
computers, cell phones or personal digital assistants. This allows business people
who travel for work to stay connected wherever they are.

19
Conclusion
Email is a wonderful way to communicate with others. Email has become a very
important way to communicate and share files with co-workers, students, friends,
and family. In this project we send successfully email with attachment. By using
send mail and PHPMailer API Predefined function. In this way we done our project
successfully with the help of project guide and coordination of team members.

20
References
• http://www.src.wits.ac.za/
• https://www.indeed.com/
• https://en.wikipedia.org/wiki/Email
• https://www.g2.com/categories/email
• https://www.it.iitb.ac.in/~vijaya/ssrvm/dokuwiki/media/cm5_l6_26may.pdf

21

You might also like