Nov 21, 2009
Pages: 1, 2

Php Send Mail Through Smtp

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Php Send Mail Through Smtp

haitamlong
Can anyone here tell me how to send mail through SMTP server with php mellow.gif I have search in many source code on web and cant find anything sad.gif

Comment/Reply (w/o sign-up)

Houdini
What you are probably really wanting to use is the mail() function which is used pretty widely with PHP.

I personally use this function on my local PC which is connectted persistently through a DSL connection (256k download and 126 upload tested) my test scripts run as long as they are coded properly and so I test them to my own e-mail address to check for errors or to make improvements to them.

If you are simply wanting to use PHP to send e-mail then just click the link above that I provided and if you have any difficulties sending to your own email then you could post again with those problems with any errors encountered or anomolies with your script and I will be glad to help you with it. You could also PM me about the problems real or imagened. Welcome to the world of PHP here on Astahost.

Comment/Reply (w/o sign-up)

mastercomputers
If you're searching for a way to send via SMTP, then I guess you don't mean the mail() function as you would find tonnes of information on that.

There's an alternative way, using PHP and sockets to connect to the SMTP server and send the commands that are requested by the SMTP server, the problem however is that most SMTP servers are set up to not allow RELAYing of messages from outside without SMTP authentification that you are actually an allowed user to use that SMTP server, reason being many SPAM mailers could use these servers to distribute their mail if they were not secured against it.

If you want to find ideas, look for SMTP via Telnet methods, and then learn PHP sockets to do the exact same thing, as the method is just the same, except you're using PHP to do what you would do in Telnet.

You will probably also need to read the RFC on SMTP so you can understand how verification and authentification is done, as well as limitations on it.

Cheers,

MC

Comment/Reply (w/o sign-up)

Hercco
Yep, you basically could build an SMTP client with PHP. It's actually quite easy if you understand protocols in general and have some experience in socket programming.

What I suggest is that you read RFC821 (for example here: http://www.ietf.org/rfc/rfc0821.txt) and then take a look at PHP manual for sockets. If you want example code, you'll be able to find tons at least in C language.

I remember reading about an open source project for a PHP class containing bunch of emailing functionalities including smtp. Unfortunately I wasn't able to find anything on it right now. And I do believe PEAR package has some sort of SMPT implementation.

Comment/Reply (w/o sign-up)

Sherif G.s
QUOTE(Hercco @ Oct 8 2006, 04:51 PM) *

Yep, you basically could build an SMTP client with PHP. It's actually quite easy if you understand protocols in general and have some experience in socket programming.

What I suggest is that you read RFC821 (for example here: http://www.ietf.org/rfc/rfc0821.txt) and then take a look at PHP manual for sockets. If you want example code, you'll be able to find tons at least in C language.

I remember reading about an open source project for a PHP class containing bunch of emailing functionalities including smtp. Unfortunately I wasn't able to find anything on it right now. And I do believe PEAR package has some sort of SMPT implementation.


this site dunt work'n bro
if ya have anysite be da same plz post it
thx

 

 

 


Comment/Reply (w/o sign-up)

WeaponX
The site does work. It's just that the forum has included the right parenthesis. This is by design. So just take away the right parenthesis...

http://www.ietf.org/rfc/rfc0821.txt

Comment/Reply (w/o sign-up)

FeedBacker
Get phpMailer .It's a nice class for sending email using smtp.
hope it helps

-James Mutuku

Comment/Reply (w/o sign-up)

iGuest-Bardiya
How to send mail using gmail as a smtp server
Php Send Mail Through Smtp

Hi
I tired a lot of scripts to send mail throug smtp and no one of them was working correctly.
One of them sends mail to spam because there were no authentication.
One of them worked cool but after sending 30-40 mail gave me an error
Error: Language string failed to load: connect_host
now I'm mixed up and really need a mail sender that it really work
Thanks a lot
Masoudmpour@yahoo.Com

-reply by Bardiya

Comment/Reply (w/o sign-up)

turbopowerdmaxsteel
I have been using phpMailer for quite sometime. However, for some reason, it is unable to send mail anymore. I don't recall changing any of the configurations either. I was using gmail as the SMTP server. But now, I have switched back to the mail function, which always works.

Comment/Reply (w/o sign-up)

(G)Pramod
cannot send mail trough php
Php Send Mail Through Smtp

 hello every one .

could anyone just give me the direct code which sends the mail from a smtp.

I have alredy used phpmailer() but is nt wrking for me it gives some error as smtp error : mail not accepted by the (abc@gmail.Com ) . This is the example id not the real one.

Please help

-question by Pramod

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
Similar Topics

Keywords : php, send, mail, smtp

  1. Using Php With A Mail Server
    (2)
  2. PHP: Need Help Sending Mail Using SMTP
    (5)
    While the mail() function of php is all bout simplicity, it lacks the otherwise necessary
    flexibility. How do I send an E-Mail using php through SMTP?....
  3. E-mail List Error
    (4)
    I just coded this e-mail list, it works well for entering data into database, but if user leaves
    the field blank or adds an already exist e-mail it gives him the error message and stops loading the
    rest of the page. CODE // Connects to your Database mysql_connect("localhost", "my_username",
    "mypassword") or die(mysql_error()); mysql_select_db("Database name") or die(mysql_error()); //This
    code runs if the form has been submitted if (isset($_POST )) { //This makes sure they did not leave
    any fields blank if (!$_POST ) {die(' No e-mail added '); } ....
  4. Using The Php Mail() Function For Images Or Attachments
    Can't find a decent tutorial! (6)
    I read the one mail() tutorial that was posted in the tutorial section and to my horror found that
    he had quoted almost verbatim from the PHP Manual off php.net, and made a comment about it, and also
    found that if you were new to PHP or the Manual that it was informative but not indepth enough for
    my tastes. This is not a tutorial although with the code that will be posted it might look like
    one, that is not its intent or purpose. I have searched and found many so called tutorials about
    MIME mail and boundries and all that but basically it either told me to use PHPMai....
  5. Sending Mail To A Mailing List
    Possibility of sending a newsletter (12)
    Task : To send an email to a list of email addresses stored in a database Premise : Page is
    written in PHP, with the database as MySQL. The email addresses need to be taken from a column of a
    table in the database which is queried with some "WHERE" clause. The email sent to these addresses
    is static. Objective : To send a newsletter to the members who have subscribed for the same on a
    website. Well, there. I have put it as objectively and as clearly as possible. I have searched
    for the keywords "mail" and "PHP" on this section of the forum, and from what I have....
  6. Simple E-mail Validation
    check for correct address and syntax (2)
    Hey , this tutorial will tell you a very simple way to check if email addresses entered are with the
    correct syntax. Hope this will help you eliminate jokers. So this script will... (check the
    characters, and check if there is a " someone somewhere.extension ". Ok, so firstly we create a
    function with all the invalid stuff in it:- CODE function CheckMail($email) { if (eregi("^ ( ?
    )*@ ( ? )*\. {2,4}$", $email)) { return true; } else { return false; } } Now, to check an
    email you just run the variable with the email in it through the function as follow....
  7. Do You Want A Mail Form In Your Site
    (2)
    Notice from m^e: Repeat post. Credits reduced by 5 days. Learn to USE
    THE SEARCH BUTTON before you make such posts. did you want to have in your web site mail form
    that allow the user to send mails to anther mail from his mail e.g. the compose in yahoo CODE
    from to cc bcc subject
    function param($Name)         {         global
    $HTTP_POST_VARS;         if(isset($HTTP_POST_VARS ))            return($H....
  8. Form Mail Php - Use Php To Send Form Through Email
    (8)
    Just sends all form data to a specified email. Does anyone know a free script that does this?....
  9. Mail() Not Working
    (4)
    I'm trying to use the mail() function in a script. But it doesnt work. It keeps returning false.
    It's a premade script The code is: CODE function SendPassword($userName) { global
    $db,$db_tables;//config.php     // set password for username to a random value     // return the new
    password or false on failure     $new_password = mt_rand();     $qry = "UPDATE $db_tables SET
    password=password('$new_password') WHERE user_name='$userName'";
        $db->db_query($qry);     // send notification email     $from = "From: $from_email\r\n";
        $msg = "....
  10. How To Set Up Form Mail
    (4)
    I am programming on a web site's contact form page, How can I mail the filled in information of
    the client to particular E-mail address? I tried form action="mailto:blah@blah", but it is running
    all right on my machine rather that other computer in our LAN. The error message I got is a
    connection failure error occurred. I noticed there are some form mail info on line, but I have no
    idea to figure out how is that works. Anybody have some experience on that? Thanks!....

    1. Looking for php, send, mail, smtp

See Also,

*SIMILAR VIDEOS*
Searching Video's for php, send, mail, smtp
advertisement



Php Send Mail Through Smtp

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com