Thanks.
HELP!!!
Moderators: Chris Corbyn, General Moderators
HELP!!!
I'm new to using PHP to send emails from a website. I usually use ASP.NET for my design but I had a client that wanted a basic site and I wanted to use PHP to send an email. I came across this site and really want to use the product but I don't know what I'm doing or what to do to get this working for me. I have a PHP editor so I'm good there. I'm just not sure what files to edit to get this working.
Thanks.
Thanks.
Re: HELP!!!
Hi, please use a more descriptive title. Titles like "help" are vague and often times gather no interest for response. You can help us help you more by using a more descriptive title. 
As far as using Swift goes, have you downloaded it and installed it?
You can download it from here: http://sourceforge.net/project/showfile ... _id=193923
Instructions for installing are here: http://www.swiftmailer.org/wikidocs/
You don't need to edit any files to get it working, however you do need to create a new file to use the Swift software. Sample files are included in the documentation, such as how to send a basic email: http://www.swiftmailer.org/wikidocs/v3/tutorials/basic
As far as using Swift goes, have you downloaded it and installed it?
You can download it from here: http://sourceforge.net/project/showfile ... _id=193923
Instructions for installing are here: http://www.swiftmailer.org/wikidocs/
You don't need to edit any files to get it working, however you do need to create a new file to use the Swift software. Sample files are included in the documentation, such as how to send a basic email: http://www.swiftmailer.org/wikidocs/v3/tutorials/basic
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: HELP!!!
Okay. Sorry about that.
Say I was to use the following code:
I'm using GMAIL account to send to.
What is the "foo@bar.tld" and "me@mydomain.com" ????
Say I have some data that I'm sending to the mail.php from a form and it looks like this....
Say I was to use the following code:
Code: Select all
<?php
//Load in the files we'll need
require_once "lib/Swift.php";
require_once "lib/Swift/Connection/SMTP.php";
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.your-host.tld"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
//Now check if Swift actually sends it
if ($swift->send($message, "foo@bar.tld", "me@mydomain.com")) echo "Sent";
else echo "Failed";
?>
What is the "foo@bar.tld" and "me@mydomain.com" ????
Say I have some data that I'm sending to the mail.php from a form and it looks like this....
What am I doing wrong?$body = " Name: " . $_POST['SenderName'] . " /n Email: " . $_POST['SenderEmail'] . " /n Message: " . $_POST['SenderMessage'] . "";
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: HELP!!!
Did you even read the documentation? Those fields are for the sender and the recipient(s).
I'm not sure what you mean by what are you doing wrong. What's going wrong?
PS: \n, not /n
I'm not sure what you mean by what are you doing wrong. What's going wrong?
PS: \n, not /n
Re: HELP!!!
Do i have my " and my ' in the right place or the wrong?
Re: HELP!!!
I uploaded the lib folder to my site. After doing this and I attempt to submit a message I get the following error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Hosting\3384878\html\ShireTest\sendemail.php on line 41.
In the sendmail.php file line 41 looks like this.
What could be wrong?
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Hosting\3384878\html\ShireTest\sendemail.php on line 41.
In the sendmail.php file line 41 looks like this.
Code: Select all
$MySubject = " . $_POST['SenderSubject'] . ";
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: HELP!!!
This is basic PHP so perhaps you need to learn a little PHP before continuing. Drop the " . and the . ", they are what is breaking that line of code.
If you put
If you put
Code: Select all
and [ /php] tags around your code in this forum you'll see with syntax highlighting why that is broken:
[syntax=php]$MySubject = " . $_POST['SenderSubject'] . ";[/syntax]
Strings are red... notice what the above looks like with syntax highlighting?
Now look at this correct version:
[syntax=php]$MySubject = $_POST['SenderSubject'];[/syntax]
It sounds as though you need to download a proper PHP editor too (are you using windows notepad or some other plain-text editor?). PHP editors will do such syntax highlighting for you so that you can easily see your syntax errors such as the above.