| SitePoint Sponsor |














That's probably it.
Possibly in both (this isn't my area). Here is some info about swiftmailer (about half way down): http://swiftmailer.org/docs/sending.htmlIf this is it,where should i put this in the swiftmailer? or php.ini ?
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.




Yes this is an SMTP If this is the SMTP of the ISP of your neighbor then you can use this. Nowadays ISP's don't allow a person to use their Internet and a different SMTP (unless the person has their own mail server); instead they enforce that traffic over their network goes through their SMTP. This is why you need to use the SMTP supplied by the ISP you travel-over.
You would put this SMTP into the swiftmailer configuration.
Regards,
Steve




Hi ServerStorm,
I tried to put in the swiftmailer but when i run my reg.php it will echo failed.I don't know why.You would put this SMTP into the swiftmailer configuration.
here is my code please correct me if i am wrong.
reg.php
Code:<?php require_once './lib/swift_required.php'; // Create the Transport $transport = Swift_SmtpTransport::newInstance() ->setHost('smtp.pldtdsl.net') ->setPort('25') ; //MAIL $transport = Swift_MailTransport::newInstance(); // Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); // Create the message $message = Swift_Message::newInstance() // Give the message a subject ->setSubject('This is my subject') // Set the From address with an associative array ->setFrom(array('jemz@yahoo.com' => 'Jemz')) // Set the To addresses with an associative array ->setTo(array('myemail@yahoo.com' => 'jemjem')) // Give it a body ->setBody('Here is the message itself') ; // Send the message if ($mailer->send($message)) { echo "Sent\n"; } else { echo "Failed\n"; } ?>
Hi jemz,
You have put the SMTP in the correct place.
Do you know if this is an authenticated or non-authenticated SMTP? If it is authenticated then you will need to ensure that you provide the authentication details. You could ask your neighbour for the credentials if the are willing to share them with you.
before trying to get this working in SwiftMailer, maybe first try sending an email using the command line. Here is a link to a tutorial that shows you how to do this. If you use this technique and it successfully sends an email, then it is a problem with your credentials/settings; however if you are unsuccessful then you need to get to a point where you can do it via the command line before setting up your SwiftMailer config.
If you are wondering why do it using the command line. The reason is that it will show you all connection, data and sending steps that you don't see behind a mail client.








Hi ServerStorm, I tried it but i got problem in theit will says access denied.rcpt toaddress>
myRealEmail@yahoo.com-just assume that is my real email address
here is the result in the command prompt
Code:220 mta3.zimbra.epldt.net ESMTP Postfix ehlo example.com 250-mta3.zimbra.epldt.net 250-PIPELINING 250-SIZE 157286400 250-VRFY 250-ETRN 250-AUTH PLAIN LOGIN 250-AUTH=PLAIN LOGIN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from: test@example.com 250 2.1.0 Ok rcpt to: myRealEmail@yahoo.com 554 5.7.1 <myRealEmail@yahoo.com>: Relay access denied
Hi jemz,
Do you have an Public MX record setup for your example.com (whatever the real domain is)? If not, then make sure you have a valid MX record. Often times this 'access denied is due to the lack of a proper mx record.
Also ensure you have created a reverse PTR record for the DNS entry for your example.com email server as well. Once you have this done then test and we'll go from there.




Hi ServerStorm, Thank you for the reply...I am confuse.i thought i could just send simple mail php code in my localhost,..with out any configuration about what you have said.andPublic MX record setupMy point is just to try send mail using swiftmailer and simple php code..I have no domain like www.mypage.com...Also ensure you have created a reverse PTR record for the DNS entry for your example.com email server as well. Once you have this done then test and we'll go from there.
If you are trying to route out messages from example.com to a public mail address like someone@yahoo.com, then you need to have a MX record in place for your server where the email is sent from. No matter if you are trying to do something simple, you are still creating a mail server using SwiftMailer. This means that the DNS configurations that normally have to be done for a mail server must be done for your SwiftMailer as well.
Mail servers that will receive mail from your SwiftMailer will likely be set to validate your mail server. If no public DNS records exist (MX, Reverse PTR) then many receiving mail servers will reject such messages.
I hope this clears it up why you have to get this sorted out.


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.




Hi ralph, why you said i am off topic i am just explaining serverstorm that i have no live website. like www.mywebsite.com.....by the way sorry for my english but i am trying to ask some help like you and serverstorm or other who reads my thread...I apologize for my English if you misinterpret.
![]()




You're English has been improving since you first posted on Sitepoint. We understand most things and you always make a good effort to communicate, so no worries.
To do the test you are trying, someone@example.com to someone@yahoo.com. The mail route goes like this:
SwifthMailer -> sends message -> ISP SMTP -> message is routed -> Yahoo's Mail Server(s) -> What is the MX record of the mail server sending this? What is the reverse DNS for this sender (if it doesn't have one it is unsafe and likely a Spammer). Oh, these records doesn't exist. We will not deliver this so send error. -> error sent -> goes through ISP SMTP -> gets to SwiftMailer (or command line, or mail client).
To fix this you need to have two DNS (Domain Name Service) records created; an MX record that list mx.yourdomain.com and a reverse pointer record that points your I.P. address, say your address is 202.57.125.196 then the reverse pointer DNS record would point 202.57.125.196 -> mx.yourdomain.com.
It is only with these records in place that some larger email providers - like Yahoo - will allow messages to be routed. You cannot create these records if you don't have an domain name. ralph.m is right in recommending that you get a cheap domain for this which will allow you to finish the test.
I hope this is a better way to describe this.
Steve




Hi serverstor,
I have free hosting i used host22 ,maybe i can get the mx record of this free hosting...please correct me if i am wrong.To fix this you need to have two DNS (Domain Name Service) records created; an MX record that list mx.yourdomain.com and a reverse pointer record that points your I.P. address, say your address is 202.57.125.196 then the reverse pointer DNS record would point 202.57.125.196 -> mx.yourdomain.com.
Hi Jemz,
You can use your free host given:
- You can set DNS records for your free domain. i.e. set an MX record in reference to your free host domain
- You do your swift mailer test from the free host as the I.P. will need to be be from the same server for the Reverse PTR record check to pass by a yahoo.com (and other) mail hosts.












Hi serverstorm, i tried this firstit sends succesfully to my yahoomail$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
i also tried thisand it's working also...$transport = Swift_SmtpTransport::newInstance('31.170.160.208', 465, 'ssl')
But what is this?,if this is the port why is it that it is successfully sent when i used the ip of the server of the free hosting,does the server of the free host and the gmail having the same port?...can you please help me to enligthen my mind.465
To best find the path that the mail travel led, look at the headers of the message that you receive from swiftmailer - your gmail account and see how it shows it routed. It will list every transaction leaving to arriving. You can't really post it here as it will make public your email addresses. Pay particular attention to the time when the message is sent and received.




Bookmarks