-1

I read through a few pages but cannot understand how email sending works. What i know is, i can send an email using php mail() function. It connects to email server iteself and sends the email. It does not know whether the email actually reached the destination or not.

what i want to know is,

  1. What is the role of MTA in all this, what does it do?

  2. Can i use php mail() function to send emails to say 1000 people at once, without using any additional softwares on my server.

Manse
  • 37,765
  • 10
  • 83
  • 108
Amna Ahmed
  • 1,944
  • 4
  • 20
  • 25
  • 1
    Yes you can use PHP to send mails to your mailing list. MTA stands for Mail transfer agent. Have you seen the phplist? It is free to download, if you download and read the source code you will know how they send emails to hundreds of thousands of users using just PHP. – Hameedullah Khan Apr 30 '12 at 08:42
  • whats your hosting arrangement? vps? shared host ? other? –  Apr 30 '12 at 09:26
  • @HameedullahKhan phplist is a good software and meets my requirements as well, but the free version puts a limit on monthly number of messsages, so i might implement my own after studying phplist. Thanks – Amna Ahmed May 01 '12 at 08:35
  • 1
    @AmnaAhmed no you can download the phplist source code for free and put it on your own server or on your own hosting. The only limit is your shared hosting mail sending limit, if you get your own server you can send unlimited emails. PHPList does not restrict you in any way. – Hameedullah Khan May 01 '12 at 10:13

2 Answers2

2

Role of MTA:

  1. receives email from the client's MUA
  2. passes email to the MDA for final delivery
  3. uses SMTP to route email between servers

See more: http://en.wikipedia.org/wiki/Message_transfer_agent

See this links for sending multiple emails:

  1. Sending mass email using PHP
  2. Sending bulk email in PHP

Update:

A message transfer agent(MTA) receives mail from either another MTA, a mail submission agent (MSA), or a mail user agent (MUA). The transmission details are specified by the Simple Mail Transfer Protocol (SMTP). When a recipient mailbox of a message is not hosted locally, the message is relayed, that is, forwarded to another MTA. Every time an MTA receives an email message, it adds a Received trace header field to the top of the header of the message, thereby building a sequential record of MTAs handling the message. The process of choosing a target MTA for the next hop is also described in SMTP, but can usually be overridden by configuring the MTA software with specific routes.

A MTA works in the background, while the user usually interacts directly with a mail user agent. One may distinguish initial submission as first passing through an MSA – port 587 is used for communication between an MUA and an MSA while port 25 is used for communication between MTAs, or from an MSA to an MTA; this distinction is first made in RFC 2476.

Community
  • 1
  • 1
Somnath Muluk
  • 55,015
  • 38
  • 216
  • 226
0

You ask two question at once:

What is the role of MTA in all this, what does it do?

The role of an MTA is being an MTA (Mail Transport Agent). Please consult any document about MTA in the internet which matches the level of detail you require.

Can i use php mail() function to send emails to say 1000 people at once, without using any additional softwares on my server.

That depends on your operating system. Strictly spoken this is only possible on windows with an external smtp server while on linux you always have sendmail which is used by php mail() then which means, you can not send a single mail (and therefore not a thousand mails) with mail() on linux without a program on your server (sendmail).

hakre
  • 193,403
  • 52
  • 435
  • 836
  • My server does have the sendemail module, because it allows me to send emails to hotmail account through the contact form, thanks for help. So sending 1000 emails is no different than sending 1000? i mean same loop can be run 1000 times changing the variables for to and name every time? – Amna Ahmed Apr 30 '12 at 10:56
  • If you only need to change the email address, you should not re-invent the wheel but instead use some software that does the mass-mailing for you like a mailing list. As you're using linux, you'll find plenty of those with your software distribution. – hakre Apr 30 '12 at 12:07