Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in AWS by (19.1k points)

I am using an Amazon EC2 instance to serve a node.js app. I recently purchased a domain name through Google Domains and I want to use that domain name to access my node.js app.

The Google Domains console allows you to forward your domain traffic to another website. I set it to forward traffic to the public IP address of my EC2 instance. I can access my app just fine now, but when I type www.myDomainName.com into a web browser, the URL bar immediately changes and displays the digits of my EC2 IP address.

I would like the URL bar to display the name of my domain instead.

Note:

I have read a few SO questions related to this and can't figure it out. Some of them are a bit over my head. Many of them say to use an Amazon Elastic IP, but I don't understand why this is necessary if the public IP of my EC2 instance seems to work just fine. If the solution here is to use Amazon Elastic IP, I would really appreciate an explanation as to why that is necessary,

1 Answer

0 votes
by (44.4k points)

I finally got SES to work, but now I'm confronted with another problem

The email sent leaves amazonses.com in the form and mailed-by fields like this

I am currently on sandbox access

from:    [email protected] via amazonses.com 

to:  [email protected]

date:    Sat, Jun 2, 2012, at 3:30 PM

subject:     Subject message

mailed-by:   amazonses.com

question: how can I remove amazonses.com from these 2 fields and replace the 'mailed-by' field with my companies email address? 

here's my php

function sendMail($to, $subject, $message, $from ) {

    require_once('sdk-1.5.6.2/sdk.class.php');

    $AWS_KEY = "********************";

    $AWS_SECRET_KEY = "****************************************";

    $amazonSes = new AmazonSES(array( "key" => $AWS_KEY, "secret" => $AWS_SECRET_KEY ));

    $response = $amazonSes->send_email(

        $from,

        array('ToAddresses' => array($to)),

        array(

            'Subject.Data' => $subject,

            'Body.Html.Data' => $message,

        )

    );

    if (!$response->isOK()) {

        return false;

    }else {

        return true;

    }

    return false;

}

sendMail('[email protected]', "Body message", "Subject message", "[email protected]" );

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...