Jump to content

PHP Send Mail


fatboymills

Recommended Posts

No.  Maybe you should start with a more reliable learning process.....  Copying other's code serves no useful purpose at your stage of this game.

 

Now that I know that you are not even attempting to write code, I'll depart. 

 

Good luck

Edited by ginerjm
Link to comment
Share on other sites

Hi fatboymills,

 

I will apologize in advance, because I know this is going to come off as a lecture, but sometimes you just have to be completely honest if you want to actually get anywhere.

 

I didn't write the code I searched for it and tried to modify. I'm just trying to learn php, so I don't know what you mean by suppressed functions. Maybe I should start with a more reliable script?

To use an analogy, you are approaching this like someone who found an iPhone, and you come into an electronics forum and ask people for "help" with replacing the built-in camera circuitry and camera lense so that you can take 2 pictures at the same time.

 

It's an electronic engineering forum after all, full of people who design and engineer phones, so these people start to brainstorm, and only then do you admit that you have absolutely no clue about how the phone works, how the firmware works, how electronics work, and at that point, after people have wasted their valuable time getting nowhere with you because you are completely out of your element and incapable of actually engaging with them, your question is: "Should I go get another phone?"

 

That's not the point. You have no business engaging with people on how to change a phone until you learn some basics about how the phone actually works, and how you can safely modify it.

 

Your problem is trivial to the people who have already replied to you. You just don't understand the first thing about php. You need to remedy that if you want to achieve your stated goals. Sorry but it had to be said.

Link to comment
Share on other sites

Point taken, No I don't know the first thing about PHP. I had no idea the forum was not for programmers? I am just tying to set something up for my job. If you were on my car repair forum you wouldn't be kicked out for being a non-mechanic. But Sorry to waste your time. Good Luck.

Link to comment
Share on other sites

Point taken, No I don't know the first thing about PHP. I had no idea the forum was not for programmers? I am just tying to set something up for my job. If you were on my car repair forum you wouldn't be kicked out for being a non-mechanic. But Sorry to waste your time. Good Luck.

phpfreaks is for php programmers, whether they be pros, hobbyists, students or hackers.

 

What it isn't, is a cooperative of people sitting around waiting to do free work for people, although that certainly has happened inadvertently over the years.

 

Absolutely nobody who answers questions gets paid to do so, in case that helps clarify things for you. It's not our way to tell people to GTFO, but I also don't think it serves anyone to think that we are sitting around here waiting to do free programming for people. PHP is extremely accessible in its simplest form, as in the case of the script you started with, and often people who aren't "programmers" are still smart enough to understand the basics and make simple changes. We are for the most part happy to help those people, so long as we perceive that they are making a genuine effort to learn enough to do the work themselves, rather than demand spoon feeding, ie. "please just show me the codez I need to make this work the way I asked you to".

 

I might walk into Home Depot and ask them for help on what I need to do to put in a new bathtub in my house, even though I'm not a carpenter or a plumber. The Home Depot people will probably put up with a lot of stupid questions, but what they won't put up with is me demanding they get in my car, and drive with me over to my house, so that they can do the installation for me, for free.

Link to comment
Share on other sites

I don't plan to beat a dead horse. You state you have code working, but what you actually are doing is sending 2 separate emails.

 

Here's some info for you:

 

mail(....);
Calling the mail function.

 

@mail(...);
Calling the mail function, but SUPPRESSING errors (because the @ was used at the front of the function call name). Now if mail was to return an error, you will never see it.

 

Your code, sending 2 separate emails:

 

@mail($email_to, $email_subject, $email_message, $headers );
@mail($email_from, $email_subject, $email_message, $headers );
People advised you that all you really needed to do was provide a string that contained a comma separated list ("email1, email2").

 

What you should have done:

 

 

// send one email to both recipient and sender.

mail($email_to . ',' . $email_from,  $email_subject, $email_message, $headers);
Of course the best way to do this would probably be to send yourself a bcc: copy instead.

 

I also don't know if you understand this or not, but this form is basically an open door allowing anyone to spam anyone else using your site as the spam delivery mechanism. Writing a bot to take a database of people would be trivial. This is just an open invitation to getting yourself exploited for spam delivery, but something tells me your email may already be seen as spam only you just haven't figured that out yet. Sending email programmatically from a server requires quite a bit of knowledge about DNS, MTA's, SPF, DKIM and other things you probably aren't aware of.

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.