Question

Emails not sending on Magento

Asked by: Tricky1974

I'm setting up an online store using Magento (Just on localhost at the moment) and i'm stumbling across a few problems with the emails.

I've set up the email templates in System > Transactional Emails and also set up the necessary fields in System > configuration > web > contacts, but it's not working.

When attempting to use the contact form, I just get the error:
"Unable to submit your request. Please, try again later".

The problem is much the same with the sales emails.  The order goes through fine on the system but the email doesn't send.

Any ideas?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-10 at 07:53:42ID24640116
Tags

Magento

Topics

Web Services

,

PHP Scripting Language

,

Miscellaneous Web Development

Participating Experts
2
Points
500
Comments
28

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Sales support template
    Hello. We are looking for a tool that will help us with marketing and sales support. What would be ideal is a template where we select a contact and choose between for example "Send mail", "Make document" and "Make fax". Later we can easely look...
  2. Indexer stumbling
    Hi all, I've got our company indexer indexing our 3 File transfer protocol sites and it's working great thanks to you guys, but when I send it off to index more than one site it's stumbles with the error: <!--- Begin error ---!> Error Diagnostic Information Inva...
  3. Sending emails thru localhost
    Hi, I developed a .NET program which send emails and for some reason I get "Relay Access Denied". I tried to telnet with : ......... telnet localhost 25 helo mail from:<from_mail> rcpt to:<to mail> data test . quit ........... and I get "sender OK...
  4. Tracking sales
    how can sales be tracked in asp? for example when a customer lands in: www.test.com/default.asp?referer=google And the payment page is payment.asp How can you track if it was a sale coming from a google referal? Tks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: samwood09Posted on 2009-08-10 at 07:55:52ID: 25060462

if its on your localhost thats why it can sometime cause errors, due to sendmail not beign set up

 

by: Tricky1974Posted on 2009-08-10 at 07:57:36ID: 25060482

Hi, thanks for the reply.  

How would one go about setting up sendmail?

 

by: samwood09Posted on 2009-08-10 at 07:58:36ID: 25060493

what server do u have setup. eg   xammp or summit like that or have u just downloaded apache and php and done it that way?

 

by: Tricky1974Posted on 2009-08-10 at 07:59:33ID: 25060504

I'm using xampp.

 

by: samwood09Posted on 2009-08-10 at 08:01:33ID: 25060534

right okay

i want you to run this test script

// change the to address

<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

 

by: Tricky1974Posted on 2009-08-10 at 08:07:29ID: 25060597

Okay, I've done that and got this nice little error:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\test\test.php on line 12

Message delivery failed...

...Was a from field required in there somewhere?

 

by: samwood09Posted on 2009-08-10 at 08:10:33ID: 25060625

try adding a from

it shouldnt need one but just to check , i will sort out ur php.ini file if it still errors

<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$from = "";
if (mail($to, $from, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

 

by: Tricky1974Posted on 2009-08-10 at 08:13:48ID: 25060649

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\phpTest\test2.php on line 13

Message delivery failed...

Same problem still.

 

by: samwood09Posted on 2009-08-10 at 08:15:34ID: 25060665

hmm ok

<?php
$to = "xvsjw@delcam.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$from = "me@swoodcock.co.uk";
if (mail($to, $from, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:

Select allOpen in new window

 

by: Tricky1974Posted on 2009-08-10 at 08:19:04ID: 25060706

Yeah, I've tried it with different emails in the from and to fields.  No such luck though.  

I hope i'm doing as you asked. I've just made a basic HTML page with your php in it and hosted it in my xampp htdocs.

 

by: samwood09Posted on 2009-08-10 at 08:25:23ID: 25060781

yeah thats fine that should of sent, right, try something else now

Method 1:

- Open php.ini file and uncomment the php_smtp.dll extension. This is required when sending emails to a remote server.

- Scroll down and find the following lines:


[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
 
; For Win32 only.
;sendmail_from = me@example.com

                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

 

by: samwood09Posted on 2009-08-10 at 08:25:45ID: 25060785

- From the lines above, uncomment SMTP, smtp_port and sendmail_from
directives, then add SMTP server, SMTP port number and your preferred email address to SMTP, smtp_port and sendmail_from directives respectively, your final code should be similar to the one below:

[mail function]
; For Win32 only.
SMTP = mail.server.com
smtp_port = 25

; For Win32 only.
sendmail_from = something@server.com

 

by: Tricky1974Posted on 2009-08-10 at 08:29:28ID: 25060835

This may sound like a silly question; where can I find php.ini?  I'm sure i've been in it before, but can't find it now.

 

by: Tricky1974Posted on 2009-08-10 at 08:30:54ID: 25060851

Oh wait, I think I've got it.  Xampp>php>php.ini?

 

by: samwood09Posted on 2009-08-10 at 08:30:56ID: 25060853

C:\xampp\php

 

by: Tricky1974Posted on 2009-08-10 at 08:36:32ID: 25060906

I've done what you said above, but still not having much luck

 

by: samwood09Posted on 2009-08-10 at 08:37:44ID: 25060921

right okay hold on

 

by: samwood09Posted on 2009-08-10 at 08:39:29ID: 25060938

1. Modify your sendmail.ini

Your sendmail.ini should be located in C:\xampp\sendmail\sendmail.ini. You only need to be concern with 3 variables here:

   1. smtp_server
   2. auth_username
   3. auth_password

Get them filled in, an example would be as follows:

[code]smtp_server=smtp.justrealized.com
auth_username=outgoing@justrealized.com
auth_password=dp2hsn12[/code]

Most SMTP servers require authentication. I just setup an email through my Media Temple account. (By the way, i.justrealized.com is hosted by Media Temple, if youre interested in their service and would be kind enough, consider quoting RYNSE.COM without quotes as your referrer. This would give me a bit of discount for my yearly subscriptions. Thanks.)
2. Modify your php.ini

XAMPP places the php.ini inside C:\xampp\apache\bin\php.ini. You can open the file and do a search for sendmail_path. Its at line 704 for me. You can simply uncomment that line.

[code]sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"[/code]

And thats all. Now for some testing.

3. Lets test it out

[code lang="php"] $from_name = "Justrealized";
$from_email = "outgoing@justrealized.com";
$headers = "From: $from_name <$from_email>";
$body = "Hi, \nThis is a test mail from $from_name <$from_email>.";
$subject = "Test mail from Justrealized";
$to = "somewhere@justrealized.com";

if (mail($to, $subject, $body, $headers)) {
echo "success!";
} else {
echo "fail&";
}
?>

 

by: fiboPosted on 2009-08-10 at 08:41:42ID: 25060961

Are you sure you have the mandatory \n at the end of the header, just before the message content? Your mail will NOT start if this is missing

 

by: Tricky1974Posted on 2009-08-10 at 08:44:59ID: 25061000

Before I start modifying sendmail.ini (Thanks samwood09).. What's this \n that you speak of fibo?

 

by: fiboPosted on 2009-08-10 at 09:32:56ID: 25061473

The mail is transferred as lines of text.
There is a convention (defined is some RFC) which says that to know the border between the lines of the header and the beginning of the content, you need an empty line.

Not sure if your mail program generates it... just add '\n' before the first line of your content, in case it is just this stupid thing which blocks you.

 

by: Tricky1974Posted on 2009-08-11 at 01:06:09ID: 25066917

Interestingly, I got your test script to send an email using samwoods method further up.

[mail function]
; For Win32 only.
SMTP = mail.server.com
smtp_port = 25

; For Win32 only.
sendmail_from = something@server.com

I just needed to restart apache.

Though, this hasn't fixed my initial problem with sending emails through magento.  I tried putting the '\n' just before the first line of content which didn't help either.

Any more ideas anyone?

 

by: fiboPosted on 2009-08-11 at 01:16:30ID: 25066963

1 - You have been  able to send mail thru a simple php script.

2 - Have you filled in all the required fields to send mail in Magento administration page?

 

by: Tricky1974Posted on 2009-08-11 at 01:19:53ID: 25066970

Okay, I've sorted the problem!

In System > Config > System > SMTP Settings (Windows server only)

I set the host there and it's now all working fine.

 

by: fiboPosted on 2009-08-11 at 01:38:09ID: 25067060

- Solving the problem as you did exactly matches at least my suggestion in item 2 just on the preceding post.
- That mail is correctly sent thru php is also the result of oncommenting elements in php.ini

So you solving the problem results from the various experts contributions, and we would find fair that you acknowledge these.

 

by: Tricky1974Posted on 2009-08-11 at 01:46:13ID: 25067096

Hi Fibo,

I'm very sorry, if you look at the times of my previous post and of your soloution, you must of been typing your comment at the the same time I was typing mine !!

I really apreciate all the time yourself and Samwood09 have put in.

 

by: Tricky1974Posted on 2009-08-11 at 01:50:23ID: 31613743

Thanks for all your Help, most apreciated !!

 

by: fiboPosted on 2009-08-11 at 01:55:06ID: 25067134

B-)) glad we could help. Thx for the piints and grade

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...