Micro Project WBP Reaming Index
Micro Project WBP Reaming Index
Ms.Mrunal.U.Desai Miss.Gurav.J.N
Project Guide HOD
Dr.S.R.Pawaskar
Principal
Date- / /2025
Place- Talsande
Introduction
PHP | 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 this 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.
Advantages:-
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. Sometimes attachments and files sent by email contains virus which may
affect your computer.
5. Files may not be uploaded or downloaded properly from email if internet
speed is slow
Features of emails:-
2. Once you have selected the appropriate file, it is attached to the mail.
3. Usually a paper clip icon appears in the email which indicates that it has an
attachment.
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 instanty
SMTP Protocol
In the SMTP model user deals with the user agent (UA) for example Microsoft
Outlook, Netscape, Mozilla, etc. In order to exchange the mail using TCP,
MTA is used. The users sending the mail do not have to deal with the MTA it
is the responsibility of the system admin to set up the local MTA. The MTA
maintains a small queue of mails so that it can schedule repeat delivery of mail
in case the receiver is not available. The MTA delivers the mail to the
mailboxes and the information can later be downloaded by the user agents.
Components of SMTP
First, we will break the SMTP client and SMTP server into two components such
as user agent (UA) and mail transfer agent (MTA). The user agent (UA) prepares
the message, creates the envelope and then puts the message in the envelope. The
mail transfer agent (MTA) transfers this mail across the internet.
SMTP allows a more complex system by adding a relaying system. Instead of just
having one MTA at sending side and one at receiving side, more MTAs can be
added, acting either as a client or server to relay the email.
The relaying system without TCP/IP protocol can also be used to send the emails
to users, and this is achieved by the use of the mail gateway. The mail gateway is a
relay MTA that can be used to receive an email.
Use case diagram
Conclusion
In this project we collect the different information related to Sending emails with
attachments and develop our project. In this project we learn about Sending emails
with attachments and their features, advantages and disadvantages. In this way we
done our project successfully with the help of project and coordination of team
members.
References
1. www.w3schools.com
2. www.phptpoint.com
3. www.geeksforgeeks.org
4. www.tutorialspoint.com