Jump to content

tep_mail()


ArtbyPatrick

Recommended Posts

Hello,

 

I am trying to figure this emailing thing for my customer, still very new at php. After a little bit of research, it is my understanding, correct me if I am wrong, that tep_mail needs to have 6 variables between parentheses??

 

like this? :

function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address)

What I am trying to do is for my customer to receive 4 variables in his email:

 

first name, last name, email address and phone number (declared as location) but I come up with seven elements in the pârentheses:

tep_mail("cutomer@email.com", "customer@email.com", EMAIL_CONTESTANT_SUBJECT, $contestant_name, $contestant_lastname, $contestant_email, $contestant_location);

I know this isnt right because my customer only receives the first name and email address. Although $constestant_location is defined as the phone number and $contestant_lastname is pretty much self-explanatory.

 

What am I doing wrong?

Link to comment
Share on other sites

tep_mail() isn't a php function.

 

EDIT

 

Looks to me like it's a php framework, hopefully you knew that. I didn't. Looks interesting though it doesn't appear that they have a forum. Wonder why?

 

http://www.oscommerce.com/

Edited by niche
Link to comment
Share on other sites

what he's trying to say is that tep_mail isn't native to PHP, it's part of that framework he linked to. Are you aware that your client is using a framework?

 

So, to solve your issue, you need to find some sort of documentation that tells you how that function works. That link was intended as a starting point for you. I did a search and found this from the top link

http://www.oscdox.com/crossx/nav.html?_functions/index.html

 

tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) X-Ref

Send email (text/html) using MIMEThis is the central mail function. The SMTP Server should be configuredcorrect in php.iniParameters:$to_name The name of the recipient, e.g. "Jan Wildeboer"$to_email_address The eMail address of the recipient,e.g. jan.wildeboer@gmx.de$email_subject The subject of the eMail$email_text The text of the eMail, may contain HTML entities$from_email_name The name of the sender, e.g. Shop Administration$from_email_adress The eMail address of the sender,e.g. info@mytepshop.com

Edited by thescientist
Link to comment
Share on other sites

According to the documentation, doing this:

 

tep_mail("cutomer@email.com", "customer@email.com", EMAIL_CONTESTANT_SUBJECT, $contestant_name, $contestant_lastname, $contestant_email, $contestant_location);

 

is going to set the $contestant_name variable to the email text, the $from_email_name is going to be set to $contestant_lastname, the $from_email_address is going to be $contestant_email, and the function will ignore the last parameter since it only expects 6 (unless there is an undocumented parameter, which might be the case if it isn't throwing an error about invalid parameters). Is that what you want to do? You want to use $contestant_name as the email text and $contestant_lastname as the value for the "From" on the email?

Link to comment
Share on other sites

Then follow the documentation. It tells you what each parameter is and in what order it expects them in, so you just need to pass them in the right order.

Link to comment
Share on other sites

Yes thanks for your reply scientist, I am aware that I have to follow the parameters that are listed in order. I guess I did not formulate my question correctly:

 

How do I make sure that the first name and last name are being entered in the email_text parameter?

 

Right now, I have 7 parameters to send but I can only use 6. Is there a way to have $contestant_name and $contestant_lastname entered in the email_text parameter and if so, how to I write this in?

Link to comment
Share on other sites

concatenate them.

$name = $contestant_name . ' ' . $contestant_lastname;

but you can't pass parameters that don't match the expected parameters of the function. You can keep concatenating more variables to build up the body as one large string though.

Edited by thescientist
Link to comment
Share on other sites

The function always takes 6 parameters. Build the email text however you want to build it in its own variable first, and then pass that variable as the email text parameter. It sounds like you're just asking how to construct a string variable.

 

http://php.net/manual/en/language.types.string.php

 

Just build the email text first with whatever information you want, and then pass that variable to the mail function.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...