How do i send message to email?

Hi serverstorm, Thank you for the reply…but i am still confuse maybe i could not yet understand or the flow in using the mail server…Okay i will just write back to you if i have some idea on what you have said…thank you again for the help.:slight_smile:

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,

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.

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.

Hi Jemz,

You can use your free host given:

  1. You can set DNS records for your free domain. i.e. set an MX record in reference to your free host domain
  2. 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, Thank you, okay i will give a try on this.I will write back to you.

Hi serverstorm, I forgot to ask ,…if i use the free host domain,should i put my php file or upload it to the free host?or is it okay that my reg.php will be in my local file.no need to put the reg.php file to the free hosting…I hope you get what i mean.:slight_smile:

Hi Jemz,

You will need to move the php files to the free host.

Hi serverstorm, i tried this first

$transport = Swift_SmtpTransport::newInstance(‘smtp.gmail.com’, 465, ‘ssl’)

it sends succesfully to my yahoomail

i also tried this

$transport = Swift_SmtpTransport::newInstance(‘31.170.160.208’, 465, ‘ssl’)

and it’s working also…

But what is this

465
?,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.

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.

Hi serverstorm, Thank you for the reply…Okay i will not post the email address…did i get the right way in using the swiftmailer?..

Hi serverstorm, why is it will allow to sent message even i did not put smtp and the port to the swiftmailer but still it will allow to send message to my gmail and yahoo. and i checked my email i received it.:confused2

Hi Jemz,

Normally your are supposed to use the SMTP of the email server’s local network. This means that normally you should put the smtp of your free host into swift mailer and NOT gmail’s or the I.P. of gmail’s SMTP. Remember, SMTP are supposed to ensure that valid users are sending messages. SMTP (on your local SwiftMail server) routes the message to another mail server. You should use in Swiftmailer the SMTP of your free host.

Please post the headers of the gmail emails that your received from Swiftmailer; the one using smtp.gmail.com as the SMTP (which is the wrong SMTP by the way) and also the IP. Change your email address to user@somewhere.com. The headers will let us help answer your question of why this worked.

Steve

Hi serverstorm, I am confuse

Please post the headers of the gmail emails that your received from Swiftmailer

you mean i am going to open my gmail and then …what do you mean the “headers” can you please give me example what you mean by headers or just a screenshot.I apologize but i cannot get what is headers in the gmail.

this is what i understand

from: John Doe <someone@yahoo.com>
to: jemz <thisismygmail@gmail.com>
date: Sat, Dec 15, 2012 at 3:19 AM
subject: This is my subject jemz

please correct me if am wrong.

Thank you in advance.

Hi Jemz,

This is not your headers. What mail client do you use or do you just use web mail. If so what web mail provider do you use the most.

By default headers are not shown as the look complicated and clutter email messages. Every email has associated headers. Here is an example of what one of the sitepoint book offers headers look like:



Return-Path: <sitepoint-jdkjuld1wdkjkujku1y@createsend1.com>Received: from mailgate.somedomain.com
 (somedomaindc.somedomain.com [172.16.0.10])    by mailportal.somedomain.com (Scalix SMTP Relay 
11.4.2.12068)    via ESMTP; Tue, 18 Dec 2012 17:42:29 -0500 (EST)Received: from localhost 
(localhost.localdomain [127.0.0.1])    by mailgate.somedomain.com (Postfix) with ESMTP id 973D61BC81B7;  
  Tue, 18 Dec 2012 17:42:29 -0500 (EST)Received: from mailgate.somedomain.com ([127.0.0.1])    by 
localhost (somedomaindc.somedomain.com [127.0.0.1]) (amavisd-new, port 10024)    with ESMTP id 
ioERtUhrMu1u; Tue, 18 Dec 2012 17:42:28 -0500 (EST)Received: from localhost (localhost.localdomain [127.0.0.1])
    by mailgate.somedomain.com (Postfix) with ESMTP id 97CFB1BC81BA;    Tue, 18 Dec 2012 17:42:28 
-0500 (EST)Received: from mx120.d.outbound.createsend.com (mx120.d.outbound.createsend.com
 [27.126.148.120])    by mailgatesomedomain.com (Postfix) with ESMTP id 4A0CF1BC81B7    for
 <user@example.com>; Tue, 18 Dec 2012 17:42:28 -0500 (EST)Received: by 
mx120.d.outbound.createsend.com id hq3ol81hsps4 for <user@example.com>; Wed, 19 Dec 2012 09:10:53 
+1100 (envelope-from <SitePoint-jdkjuld1wdkjkujku1y@createsend1.com>)Date: Wed, 19 Dec 2012 09:10:00 
+1100From: "SitePoint" <books@[sitepoint.com >Reply-To: [email]books@[URL="http://www.sitepoint.com/forums/member.php?u=442261"]sitepoint.com[/email]](http://www.sitepoint.com/forums/member.php?u=442261) To: "user@example.com" 
<user@example.com>Message-ID: <cm.091000.jdkjuld.wdkjkujku.y@createsend1.com>Subject: Day 21-  $9 
PRINT Books ... in the SitePoint Christmas SaleX-Virus-Scanned: amavisd-new at hyos.comX-Spam-Flag: 
NOX-Spam-Score: 0.253X-Spam-Level: X-Spam-Status: No, score=0.253 tagged_above=-99 required=5  
  tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, HTML_IMAGE_ONLY_24=1.618,    HTML_MESSAGE=0.001, 
RCVD_IN_DNSWL_NONE=-0.0001, T_DKIM_INVALID=0.01,    URIBL_GREY=0.424] autolearn=noX-Greylist: 
delayed 600 seconds by postgrey-1.33 at somedomaindc.somedomain.com; Tue, 18 Dec 2012 17:42:28 
ESTDKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=cm; d=sitepoint.com; h=From:To:Reply-
To:Date:Subject:MIME-Version:Content-Type:List-Unsubscribe:Message-ID; i=books@[sitepoint.com](http://www.sitepoint.com/forums/member.php?u=442261) ; 
bh=tD1RRy0KGmntoJR4rq1xJ/8hMq8=; 
b=D1qt8YS9ROCzXG8MyJ9cORW5jqu8h/WgyECiMhT8ONo3m4++74zp26TlzXuNYPpEoXwFEix9BmQm   
7GI5Xa0j0dxGLQu52H+waFOtsccHb9RnDyjwCnrvdXcGXikcQRrDDomainKey-Signature: a=rsa-sha1; c=nofws; 
q=dns; s=cm; d=sitepoint.com; 
b=noSahFoOXHZFOM4YRdt/PF/WI/fTRiIlump+N7E/j0G/NkfD4AUBcgHX0ZfRqqQYW+AmG3SXKoqn   
OY/e5wREg1NFNwhHgq1tsMGeW4YbWmO8lA0+RTsGSR4wGvyZ02qR;X-Mailer: Create SendX-Complaints-
To: [EMAIL="abuse@createsend1.comLis"]abuse@createsend1.comLis[/EMAIL]t-Unsubscribe: <http://unsub.createsend1.com/t/y-u-jdkjuld-wdkjkujku/>MIME-
Version: 1.0Content-Type: multipart/alternative;    
boundary="_=aspNetEmail=_20a38de9a1e24ca6b7f3e84e17291b28"--
_=aspNetEmail=_20a38de9a1e24ca6b7f3e84e17291b28Content-Type: text/plain;    charset="US-
ASCII"Content-Transfer-Encoding: quoted-printableContent-Disposition: inline

You can see the I’ve changed the smtp routed through somedomaindc.somedomain.com and the recipient is user@example.com (I’ve changed these for privacy sake). Do you now understand that you can see the full path of this SitePoint message. This is what I want to see on the messages that you sent to either your gmail or yahoo accounts as it will answer what happened when you tried your different ways of sending and they were all successful.

Regards,
Steve

Ralph’s post was not saying that you are off-topic it was showing that this part of the conversation was not directly about your topic so in these cases a poster uses [noparse][ot]Off topic idea here…[/ot][/noparse] tags around an idea to show that they are not trying to derail the original conversation.

Sorry, I missed pointing this out earlier.

Regards,
Steve

Hi steve, Thank you for the reply,…I did not use any mail client like Thunderbird,Spicebird,Claws Mail,…the one that i posted which is the php code with the configuration of swiftmailer, the one that i said before that i can send messages now, is the only one that i use in my free host.I just upload that small php code then i open my website…like this mypagesample.host22.com then it display to my browser succesfully sent.then i look at in my gmail account i see the message that i wrote in the php code.the subject is “sample mail”…the body is “you got it”…

Hi Jemz,

Ok, without reviewing the headers we are less likely to figure out why this works. Glad this works for you and hopefully that weird configuration that lets you route a mail doesn’t cause you any problems.

Regards,
Steve

Hi serverstorm, can i ask something where did you get the one that you posted,in the address bar when you send the message?i am thinking where did you see that.

Hi Jemz,

Sorry I don’t understand your question?

Hi ServerStorm, this one


Return-Path: <sitepoint-jdkjuld1wdkjkujku1y@createsend1.com>Received: from mailgate.somedomain.com
 (somedomaindc.somedomain.com [172.16.0.10])    by mailportal.somedomain.com (Scalix SMTP Relay 
11.4.2.12068)    via ESMTP; Tue, 18 Dec 2012 17:42:29 -0500 (EST)Received: from localhost 
(localhost.localdomain [127.0.0.1])    by mailgate.somedomain.com (Postfix) with ESMTP id 973D61BC81B7;  
  Tue, 18 Dec 2012 17:42:29 -0500 (EST)Received: from mailgate.somedomain.com ([127.0.0.1])    by 
localhost (somedomaindc.somedomain.com [127.0.0.1]) (amavisd-new, port 10024)    with ESMTP id 
ioERtUhrMu1u; Tue, 18 Dec 2012 17:42:28 -0500 (EST)Received: from localhost (localhost.localdomain [127.0.0.1])
    by mailgate.somedomain.com (Postfix) with ESMTP id 97CFB1BC81BA;    Tue, 18 Dec 2012 17:42:28 
-0500 (EST)Received: from mx120.d.outbound.createsend.com (mx120.d.outbound.createsend.com
 [27.126.148.120])    by mailgatesomedomain.com (Postfix) with ESMTP id 4A0CF1BC81B7    for
 <user@example.com>; Tue, 18 Dec 2012 17:42:28 -0500 (EST)Received: by 
mx120.d.outbound.createsend.com id hq3ol81hsps4 for <user@example.com>; Wed, 19 Dec 2012 09:10:53 
+1100 (envelope-from <SitePoint-jdkjuld1wdkjkujku1y@createsend1.com>)Date: Wed, 19 Dec 2012 09:10:00 
+1100From: "SitePoint" <books@sitepoint.com >Reply-To: books@<a href="http://www.sitepoint....epoint.com</a> To: "user@example.com" 
<user@example.com>Message-ID: <cm.091000.jdkjuld.wdkjkujku.y@createsend1.com>Subject: Day 21-  $9 
PRINT Books ... in the SitePoint Christmas SaleX-Virus-Scanned: amavisd-new at hyos.comX-Spam-Flag: 
NOX-Spam-Score: 0.253X-Spam-Level: X-Spam-Status: No, score=0.253 tagged_above=-99 required=5  
  tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, HTML_IMAGE_ONLY_24=1.618,    HTML_MESSAGE=0.001, 
RCVD_IN_DNSWL_NONE=-0.0001, T_DKIM_INVALID=0.01,    URIBL_GREY=0.424] autolearn=noX-Greylist: 
delayed 600 seconds by postgrey-1.33 at somedomaindc.somedomain.com; Tue, 18 Dec 2012 17:42:28 
ESTDKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=cm; d=sitepoint.com; h=From:To:Reply-
To:Date:Subject:MIME-Version:Content-Type:List-Unsubscribe:Message-ID; i=books@sitepoint.com ; 
bh=tD1RRy0KGmntoJR4rq1xJ/8hMq8=; 
b=D1qt8YS9ROCzXG8MyJ9cORW5jqu8h/WgyECiMhT8ONo3m4++74zp26TlzXuNYPpEoXwFEix9BmQm   
7GI5Xa0j0dxGLQu52H+waFOtsccHb9RnDyjwCnrvdXcGXikcQRrDDomainKey-Signature: a=rsa-sha1; c=nofws; 
q=dns; s=cm; d=sitepoint.com; 
b=noSahFoOXHZFOM4YRdt/PF/WI/fTRiIlump+N7E/j0G/NkfD4AUBcgHX0ZfRqqQYW+AmG3SXKoqn   
OY/e5wREg1NFNwhHgq1tsMGeW4YbWmO8lA0+RTsGSR4wGvyZ02qR;X-Mailer: Create SendX-Complaints-
To: [email]abuse@createsend1.comLis[/email]t-Unsubscribe: <http://unsub.createsend1.com/t/y-u-jdkjuld-wdkjkujku/>MIME-
Version: 1.0Content-Type: multipart/alternative;    
boundary="_=aspNetEmail=_20a38de9a1e24ca6b7f3e84e17291b28"--
_=aspNetEmail=_20a38de9a1e24ca6b7f3e84e17291b28Content-Type: text/plain;    charset="US-
ASCII"Content-Transfer-Encoding: quoted-printableContent-Disposition: inli

is this be found in the address bar?because i am looking in the gmail and i could not see like this.