Forum Moderators: coopster

Message Too Old, No Replies

sending email using mail() function in php

email, mail() function, php script

         

freshfromseo

2:09 am on Feb 9, 2008 (gmt 0)

10+ Year Member



hello,

i am making a registration process in our website. all is working i can send email to others and they can receive it with their yahoo or gmail account. My prob is my boss wants it that if the user will put their email add in the company the can receive it too(example of company email add -> marketing@company.com). but the prob is they cant receive it. im using this

mail($to,$subject,$message,$headers);

is there any solutions to that? and also the email will be send to the bulk folder of yahoo. is there any remedy for that, so that it will not go to the bulk folder instead it goes to the inbox folder, and also other email account not just a public email account can also receive a confirmation email from us. please help!

barns101

4:07 pm on Feb 10, 2008 (gmt 0)

10+ Year Member



I'm not sure that I completely understand your first problem. Can a user enter both their personal and work email addresses, and you want to send the confirmation email to both? If that is the case you could just send two emails in the same way as you are currently doing it:


// Send to personal email address - $to
mail($to,$subject,$message,$headers);
// Send to work email address - $to_2
mail($to_another,$subject,$message,$headers);

Or you can send the one email to multiple recipients, separated by commas:


mail("$to, $to_another",$subject,$message,$headers);

Or you could even add further recipients via the headers.

Check out the PHP manual [php.net] for how to use these features of mail().

There are many reasons that the emails are getting sent to the Yahoo bulk email folder:

- Your mail server could be blacklisted
- The content of your email could look like spam
- Your mail server may not have a correct reverse DNS entry
- Your mail server may not be using SPF

etc...

freshfromseo

1:53 am on Feb 11, 2008 (gmt 0)

10+ Year Member



what i mean is if the user will enter their work email address, they cannot receive it...

can u give an explanation why they cannot receive it? but if they used their personal email add they can receive it.

i am using this->

mail($to,$subject,$message,$headers);

menace_sa

6:35 am on Feb 11, 2008 (gmt 0)

10+ Year Member



Its probally getting blocked as spam.

mail($sendto , $msgheading , $msg , "From: You [validemail@validdomain]");

Leave out the headers (I think you got it in wrong order , its $to, $heading, $message, $from ). By adding the [fromemail] it also assures that they can just hit the reply and it will go to the specified address.

freshfromseo

7:57 am on Feb 11, 2008 (gmt 0)

10+ Year Member



maybe it's treated as spam.

i tried your code menace, but still it doesnt work, the work email add couldnt receive a validation email. i really have to fix that prob coz this email is for our clients and most of them will use their work email add....huhuhu..please help me... i will put my code below so that you can check if i have forgotten something..

<?php
//some codes here....

$sendto = $email;
$msgheading = "Account Information and Activation";
$msg = "Hi ".$name.",

Thank you for registering in MobiTMS Ads. Below is your account info.
username: "username."
password: "password."

You need to activate your account before you can log in the site.
To activate your account please click or copy and paste the link below.

//link code

Best Regards,
Management

*Note: This is an automated mail no need to reply.
";

//mail($to,$subject,$message,$headers);
mail($sendto , $msgheading , $msg , "From: noreply@example.com");

?>

[edited by: eelixduppy at 8:02 am (utc) on Feb. 11, 2008]
[edit reason] example.com [/edit]

menace_sa

8:09 am on Feb 11, 2008 (gmt 0)

10+ Year Member



Sorry , my first was wrong,
Try adding the <> in the from email address, and remember the from email address must be a valid email address...

mail($sendto , $msgheading , $msg , "From: $name <$email>");

freshfromseo

8:32 am on Feb 11, 2008 (gmt 0)

10+ Year Member



it's ok, you dont have to say sorry.. i tried it again but still it doesnt work. the work email add i used cannot receive a validation email from us.

i wonder how did the webmasterworld team do their mail so that it will go to the work email add.. anybody from webmasterworld team..please help me.

jatar_k

3:48 pm on Feb 11, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



there are a lot of things to consider when your emails are getting tagged as spam

it could be your mail server as much as the email itself. You also need to consider that some places you send mail to are just really rigid and you may never get through.

here are some threads to get you started
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]

for a start

there are so many things that go into email that there isn't an easy answer