Re: [PHP] sending email with php
http://articles.sitepoint.com/article/code-html-email-newsletters is a straight-ahead overview of what you can/should/cant/shouldn't do in HTML e-mails. Or check out: http://www.devshed.com/c/a/PHP/Composing-Messages-in-HTML-for-MIME-Email-with-PHP/ for some heavy-duty mail classes (be sure to check the See Also section for the full story). I also referenced the following: http://www.wilsonweb.com/wmt5/html-email-multi.htm on the basics of sending multi-part e-mail (ie. plain text AND HTML). HTH. George On 23-Dec-09, at 1:58 PM, Sudhakar wrote: ?php $headers = Content-type: text/html; charset=iso-8859-1; $to=myemailaddress; $subject=Email Newsletter; $message = '!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleEmail Newsletter/title meta http-equiv=Content-Type content=text/html; charset=utf-8 / meta name=robots content=noindex, nofollow / link rel=stylesheet type=text/css href=style.css / /head body div id=wrapper div id=topmenu /div div id=content div class=leftcolumn /div div class=rightcolumn /div /div div id=footer /div /div /body /html'; if(! mail($to, $subject, $message, $headers)){ echo There was an error is sending the email; } else{ echo The email has been sent; } ? hi my question is about send an email with php like a newsletter, when we read a newsletter email its similar to a webpage which contains content, images, css and other elements i created a static webpage initially with html css and images folder after creating the page i wanted to test to see how it would look if i were to send this as an email like a newsletter. so i have created a php file with $headers = Content-type: text/html; charset=iso-8859-1; $to=myemailaddress; $subject=Email Newsletter; and $message as mentioned above has the entire html code as i used it in my static html page i also copied the style.css in the server and created images folder and copied all the images i used in my static page to the server. i created a separate folder in my webserver called newsletter and copied the php file, css file and images folder with the images i used when i accessed the index.php as http://website.com/emailnewsletter i am getting a message that The email has been sent and i am getting the email however my question is when i open this email the styles and images are not being applied and i see only the text in the static page i created. can someone let me know how i can fix this so that when i open the email it would look like the static page i created with all the styles applies and images displayed is this only possible by using specialized email softwares or can it be done by php as well with the logic used. any help will be appreciated. thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending email with php
?php $headers = Content-type: text/html; charset=iso-8859-1; $to=myemailaddress; $subject=Email Newsletter; $message = '!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head titleEmail Newsletter/title meta http-equiv=Content-Type content=text/html; charset=utf-8 / meta name=robots content=noindex, nofollow / link rel=stylesheet type=text/css href=style.css / /head body div id=wrapper div id=topmenu /div div id=content div class=leftcolumn /div div class=rightcolumn /div /div div id=footer /div /div /body /html'; if(! mail($to, $subject, $message, $headers)){ echo There was an error is sending the email; } else{ echo The email has been sent; } ? hi my question is about send an email with php like a newsletter, when we read a newsletter email its similar to a webpage which contains content, images, css and other elements i created a static webpage initially with html css and images folder after creating the page i wanted to test to see how it would look if i were to send this as an email like a newsletter. so i have created a php file with $headers = Content-type: text/html; charset=iso-8859-1; $to=myemailaddress; $subject=Email Newsletter; and $message as mentioned above has the entire html code as i used it in my static html page i also copied the style.css in the server and created images folder and copied all the images i used in my static page to the server. i created a separate folder in my webserver called newsletter and copied the php file, css file and images folder with the images i used when i accessed the index.php as http://website.com/emailnewsletter i am getting a message that The email has been sent and i am getting the email however my question is when i open this email the styles and images are not being applied and i see only the text in the static page i created. can someone let me know how i can fix this so that when i open the email it would look like the static page i created with all the styles applies and images displayed is this only possible by using specialized email softwares or can it be done by php as well with the logic used. any help will be appreciated. thanks
Re: [PHP] sending email with php
Hi Suhakar, link rel=stylesheet type=text/css href=style.css / Relative URLs won't work - when it's rendered inside the e-mail client, the relative URL has no meaning (I believe Outlook renders relative URLs relative to the temporary directory the HTML is being rendered in.) Other clients may do it relative to an imap:// URL. Try uploading the images and stylesheet to your website and putting them within the newsletter as absolute URLs (including the images) - e.g. link rel=stylesheet type=text/css href=http://www.yourwebsite.com/style.css; / Also I know this is OT and is completely up to you, but remember to include a plain-text part, and also realise that a lot of mail clients don't render images/stylesheets by default - therefore straight after the body tag before the rest of the content, put a link to an external website where recipients can view the content online. Regards, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending email with php
another point worth noting... most of the major email clients does not display external css/images by default. The user will have to grant permission explicitly.
Re: [PHP] sending email with php
No. You must have noticed gmail saying images are blocked from .. . This is done to prevent spammers from knowing if your email is authentic or not. Moreover you must have also noticed that all the news letters have a link pointing to a web page version of the newsletter.
[PHP] Sending email with php
Hi, How can i send email in php usig the smtp server? I'm looking for a tutorial or a good script. Thanks
Re: [PHP] Sending email with php
At 12:43 16-6-04, you wrote: Hi, How can i send email in php usig the smtp server? I'm looking for a tutorial or a good script. for what it's worth, i use the class from phpguru.org and try a google on [helo smtp php mail], loads of hits -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sending email to php script
On Fri, 2 Nov 2001 18:33, Adrian D'Costa wrote: On Fri, 2 Nov 2001, David Robley wrote: What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian To do the cgi compile, use all the configure values you need EXCEPT anything apache related. The compile will produce an executable called, strangely, php. Will it work with apache then? Adrian Um, I don't understand? Presumably you already have the module version of PHP running with Apache; all you need the standalone for is to non-web based stuff? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Catalogue: How to tell one sort of cat from another. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
I think someone electrified the corridor, Tom said haltingly. ^^ shouldnt that be shockingly? :p -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Fri, 2 Nov 2001, David Robley wrote: What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian To do the cgi compile, use all the configure values you need EXCEPT anything apache related. The compile will produce an executable called, strangely, php. Will it work with apache then? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] sending email to php script
On Thu, 1 Nov 2001, Jason Murray wrote: You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Fri, 2 Nov 2001 15:09, Adrian D'Costa wrote: On Thu, 1 Nov 2001, Jason Murray wrote: You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? There's nothing stopping you running both. How do you compile it for both? Adrian To do the cgi compile, use all the configure values you need EXCEPT anything apache related. The compile will produce an executable called, strangely, php. I think there are a few lines in the docs about it somewhere in the compile section. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA I think someone electrified the corridor, Tom said haltingly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Mon, 29 Oct 2001, David Robley wrote: On Sat, 27 Oct 2001 03:23, JSheble wrote: A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? You say sendmail, so do it thusly: Edit /etc/aliases and add a line like phpmail: | /pathto/your/php/script and run newaliases to update your alias database. Actually, I am still trying to figure this out when I get time. What I did was: phpmail: | lynx -dump /pathto/your/php/script But the problem is nothing appears to be capture in the script. Or rather in what format does this mail arrive. I even tried to write it to a file but nothing is written. You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? Adrian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] sending email to php script
You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? There's nothing stopping you running both. J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Wed, 31 Oct 2001 22:04, Adrian D'Costa wrote: On Mon, 29 Oct 2001, David Robley wrote: On Sat, 27 Oct 2001 03:23, JSheble wrote: A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? You say sendmail, so do it thusly: Edit /etc/aliases and add a line like phpmail: | /pathto/your/php/script and run newaliases to update your alias database. Actually, I am still trying to figure this out when I get time. What I did was: phpmail: | lynx -dump /pathto/your/php/script But the problem is nothing appears to be capture in the script. Or rather in what format does this mail arrive. I even tried to write it to a file but nothing is written. The pipe feeds the incoming data to the script as standard input - $DEITY knows what lynx would do with that, but black holes seem to be the most likely destination. Your script needs to be an executable, standalone which reads and parses data from stdin and which is the direct recipient of info from the pipe. You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q What if we need both version?? As my colleague on the eastern seaboard has noted already, you can have a module and a standalone on the same system. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Catscan: searching for kitty. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending email to php script
On Sat, 27 Oct 2001 03:23, JSheble wrote: A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? You say sendmail, so do it thusly: Edit /etc/aliases and add a line like phpmail: | /pathto/your/php/script and run newaliases to update your alias database. You'll also need to compile php as a standalone, and put as the first line of your php script #!/path/to/php -q Cheers -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA He's dead, Jim. Get his ears! - Spock -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] sending email to php script
A while ago an email came through here about how to parse out email message from a php script. The thing that was mostly of interest to me is the ability to send an email to a php script, I guess through a sendmail alias? I asked how to accomplish this, and never saw an answer come through. So I'd like to ask again :o) Does anybody know what would be required or necessary to send an email to an address that would run a php script? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sending Email via PHP on Win2K
Hi Has anyone done this? Does PHP interact with the SMTP service on the machine? Does anyone have a script that does this? thanks Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sending Email via PHP on Win2K
Check out the mail() function in the php manual. There is literally tons of info on this function. - Original Message - From: "Boaz Yahav" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 4:54 PM Subject: [PHP] Sending Email via PHP on Win2K Hi Has anyone done this? Does PHP interact with the SMTP service on the machine? Does anyone have a script that does this? thanks Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]