473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Emailing user information problem

155 100+
I want to email the results of a form to the user. Everything is being emailed except for $company, $address, $city, $state and $zip.

I'm obviously not working the ." correctly. How is the proper way of doing this? Thanks.

[PHP] function sendWelcome($user, $email, $pass){
$from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";
$subject = "website - Welcome!";
$body = $user.",\n\n"
."Welcome! You've just registered! "
."with the following information:\n\n"
."Username: ".$user."\n"
."Password: ".$pass."\n\n"
."".$company."\n"
."".$address."\n"
."".$city.", ".$state." ".$zip."\n\n"

."If you ever lose or forget your password, a new "
."password will be generated for you and sent to this "
."email address, if you would like to change your "
."email address you can do so by going to the "
."My Account page after signing in.\n\n"
."- admin";

return mail($email,$subject,$body,$from);
}[/PHP]
Jul 25 '07 #1
4 982
pbmods
5,821 Expert 4TB
Heya, David.

You'll probably find that it's easier to maintain just to do this:

Expand|Select|Wrap|Line Numbers
  1. $body = <<<EBODY
  2. {$user},
  3.  
  4. Welcome! You've just registered with the following information:
  5.  
  6. Username: {$user}
  7. Password: {$pass}
  8.  
  9. {$company}
  10. {$address}
  11. {$city}, {$state} {$zip}
  12.  
  13. If you ever lose or forget your password, a new password will be generated for you and sent to this email address, if you would like to change your email address you can do so by going to the My Account page after signing in.
  14.  
  15. - admin
  16. EBODY;
I like to enclose my variables within curly braces when using heredoc syntax, but it is not strictly necessary.
Jul 25 '07 #2
DavidPr
155 100+
Thanks, it certainly looks easier.
Jul 26 '07 #3
kovik
1,044 Expert 1GB
One thing to note about that is that you don't have any control over special characters such as \r and \n.
Jul 26 '07 #4
pbmods
5,821 Expert 4TB
Are you getting blank values where the company name, address, etc. should go? Your function only takes the Username, email address and password as arguments. Is this intentional?
Jul 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: MLH | last post by:
I print to a device that creates a PDF. Knowing the filename, how can I then embed the PDF into the body text of an OutLook Express outbound email & send to a specified address in a table? I want...
2
by: Stanley Cheung | last post by:
Hi all, I am developing the application for send emailing list, actually, i can perform to send a email 1 by 1 and do it on aspx page. I have a enquiry that how can the application change to...
3
by: tafs7 | last post by:
My code below is supposed to email me when an error occurs on the application, but it's not emailing anything. Am I missing something? I know the smtp servers I've tried work. I even added a...
2
by: Foehammer | last post by:
I am using the standard .NET method of sending an email. My users will be filling out a web form with various pieces of information. I have created a control with properties that are the same as...
4
by: Mike Moore | last post by:
What is the best way to launch outlook from an asp.net web page? Can you do this using MAPI or is there a control that you can purchase? We are unable to use SMTP. We use MS Exhange and MAPI...
0
by: Mike Grace | last post by:
Hi, I am writing a web site which sends order confirmations to users via email. Two changes that are needed are as follows: 1) PDF files are going to be attached to the email. It could be...
4
by: MW de Jager | last post by:
I am sending an email with attachments from a dotnet ASP application. If I send an email it works fine if the attachment is located in a folder on my pc, which is open to all users on that PC, it...
5
by: szag via AccessMonster.com | last post by:
First - I don't know VBA very well at all. I have report that I want to email to multiple users that give them the quantities of their Inventory parts only. So I need something that will loop...
20
by: paul814 | last post by:
I've been working on this for some time now and have gotten nowhere...hoping someone here can help. I want to take and email all records in a database for the current date when this php page is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.