Jump to content

mailing issue


thmar

Recommended Posts

I'm having a rather same scenerio here for weeks without getting a feasible solution, can any1 help me with this?? As i'm totally new to PHP, i tried many methods found online but got stuck at some stage e.g changing php.ini, using swiftmailer etc. So can any1 guide me along, assuming i jux installed my php and did nth to it...really apreciate it

 

You see, i'm currently working on a web application which involve sending emails to user. I'm using windowXP SP2, with apache installed incorporate with MySQL as my server. Rite now my code for sending the mail is :

 

 

<?php

require_once "Mail.php";

 

$from = "Sandra Sender <sender@example.com>";

$to = "Ramona Recipient <recipient@example.com>";

$subject = "Hi!";

$body = "Hi,\n\nHow are you?";

 

$host = "smtp.yahoo.com";

$username = "smtp_username";

$password = "smtp_password";

 

$headers = array ('From' => $from,

  'To' => $to,

  'Subject' => $subject);

$smtp = Mail::factory('smtp',

  array ('host' => $host,'auth' => true,

    'username' => $username,

    'password' => $password));

 

$mail = $smtp->send($to, $headers, $body);

 

if (PEAR::isError($mail)) {

  echo("<p>" . $mail->getMessage() . "</p>");

} else {

  echo("<p>Message successfully sent!</p>");

}

?>

 

 

As you can see, i'm trying to use yahoo as my external smtp mail server to help send my mail to my application end user.

 

 

Any guidance plss??? tnx alot

 

Link to comment
Share on other sites

Hi thmar, firstly, I doubt yahoo will like that too much, using their smtp surely cant be legal to do?

Secondly, I'd advise you to go to google, do a search for Apache2Triad, download and install it. Its one installer that install Apache, mysql, php and phpmyadmin all in one with no errors at all, best is that its all setup and ready to use right after the install is complete.

 

I would then advise you to grab a copy of PHPMailer, go through their tutorial on the site and use that for your script, you wont be sorry.

 

Hope any of that helps :)

 

Shaun

Link to comment
Share on other sites

  • 2 weeks later...

 

i want to send email using php5.

but dont no how to send so please how to send email i know the mail funcion.

but dont no the minimum parameters and the what kind of changes i have to made to send email in php.ini file.

AND how many headers are required and what is php mailer

thanks if someone help me

 

Link to comment
Share on other sites

Im struggling to send emails myself. Problem is, that the SMTP server isnt relaying emails. They are just discarded.

 

Hamza, google php mail function. That will bring up the mail function and some examples.

 

php mailer I believe is a helper library to help with sending mail, adding attachments etc.

 

 

 

Link to comment
Share on other sites

why don't you try using ur own server. i use a sevice called bravehost its good. £5 per month and just buy ur self a web address.

 

u see i was doing the same thing when i started to play with email. and i found it worth while in the end.

 

hope u will consider it

 

Link to comment
Share on other sites

If you cant send, maybe it is because your server has bllocked the Email sending with php and smtp sending, you should also know, that yahoo uses SSLlogin, and uses a port to send emails, eg. 25 or 587

 

Contact your webserver about the mail funcionts

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.