Professional Web Applications Themes

problem when sending mail - PHP Development

Hello Im trying to send a mail from a php-program. Im using a test program and the code for this is as follows: <?php $from = [email]memyaddress.com[/email]"; $subject = "Test"; $to = 'me2myaddress.com; $mailbody = 'mailbody'; mail($to,$subject,$message,$from); ?> When I run the page/program I get the following error msg displayed: "Warning: Failed to Connect in G:\home\server\users\me.com\cgi-bin\send.php on line 5" The mail is not delivered. I also tried with <> before and after the value in the $form. And, of course, the addresses are really ones and both are presents on the server. Does anyone know what the problem could be? ...

  1. #1

    Default problem when sending mail

    Hello

    Im trying to send a mail from a php-program. Im using a test program and the
    code for this is as follows:

    <?php
    $from = [email]memyaddress.com[/email]";
    $subject = "Test";
    $to = 'me2myaddress.com;
    $mailbody = 'mailbody';
    mail($to,$subject,$message,$from);
    ?>

    When I run the page/program I get the following error msg displayed:
    "Warning: Failed to Connect in G:\home\server\users\me.com\cgi-bin\send.php
    on line 5"

    The mail is not delivered. I also tried with <> before and after the value
    in the $form. And, of course, the addresses are really ones and both are
    presents on the server. Does anyone know what the problem could be?

    <phpbeginner>


    scott john Guest

  2. #2

    Default Re: problem when sending mail


    "powerboy" <powerboyrarextreme.com> wrote in message
    news:3f46653d$0$23613$5a62ac22freenews.iinet.net. au...
    > "scott john" <makkia55hotmail.com> wrote in message news:avt1b.20919$mU6.32889newsb.telia.net...
    > > Hello
    > >
    > > Im trying to send a mail from a php-program. Im using a test program and the
    > > code for this is as follows:
    > >
    > > <?php
    > > $from = [email]memyaddress.com[/email]";
    > > $subject = "Test";
    > > $to = 'me2myaddress.com;
    > > $mailbody = 'mailbody';
    > > mail($to,$subject,$message,$from);
    > > ?>
    > >
    > > When I run the page/program I get the following error msg displayed:
    > > "Warning: Failed to Connect in G:\home\server\users\me.com\cgi-bin\send.php
    > > on line 5"
    > >
    > > The mail is not delivered. I also tried with <> before and after the value
    > > in the $form. And, of course, the addresses are really ones and both are
    > > presents on the server. Does anyone know what the problem could be?
    > >
    > > <phpbeginner>
    >
    > Have you defined an SMTP server in php.ini ?
    Additionally, the $from variable must be a valid header, so change it to:

    $from = "From: [email]memyaddress.com[/email]";

    You may also need to check which version of PHP you're using, since this header may not be honoured
    in your version.

    [url]http://php.net/manual/en/function.mail.php[/url]



    powerboy Guest

  3. #3

    Default Re: problem when sending mail

    scott john wrote:
    >
    > Hello
    >
    > Im trying to send a mail from a php-program. Im using a test program and the
    > code for this is as follows:
    >
    > <?php
    > $from = [email]memyaddress.com[/email]";
    > $subject = "Test";
    > $to = 'me2myaddress.com;
    > $mailbody = 'mailbody';
    > mail($to,$subject,$message,$from);
    > ?>
    >
    > When I run the page/program I get the following error msg displayed:
    > "Warning: Failed to Connect in G:\home\server\users\me.com\cgi-bin\send.php
    > on line 5"
    >
    > The mail is not delivered. I also tried with <> before and after the value
    > in the $form. And, of course, the addresses are really ones and both are
    > presents on the server. Does anyone know what the problem could be?
    Also, close your quotes for the "to" line:

    $to = 'me2myaddress.com';

    not

    $to = 'me2myaddress.com;

    Shawn
    --
    Shawn Wilson
    [email]shawnglassgiant.com[/email]
    [url]http://www.glassgiant.com[/url]
    Shawn Wilson Guest

  4. #4

    Default Re: problem when sending mail

    > > Have you defined an SMTP server in php.ini ?
    Hello,

    I m developing a site which is located on a webhotell. Im testing my
    programs using ftp. If I run a page with phpinfo() then I can seee that
    there is a file named php.ini. Its on C:/. My site is on G, so I dont th8ink
    I can access that information or edit that file. What do you think?
    > Additionally, the $from variable must be a valid header, so change it to:
    > $from = "From: [email]memyaddress.com[/email]";
    I changed this, without any result
    > You may also need to check which version of PHP you're using, since this
    header may not be honoured
    > in your version.
    >
    > [url]http://php.net/manual/en/function.mail.php[/url]
    Checked this too. The version in use is the last one

    <phpbeginner>



    scott john Guest

Similar Threads

  1. Sending Mail Problem
    By jester in forum ASP.NET Security
    Replies: 2
    Last Post: November 13th, 03:29 AM
  2. [PHP] Problem sending HTML formated mail
    By David T-G in forum PHP Development
    Replies: 2
    Last Post: September 18th, 07:22 PM
  3. Problem sending HTML formated mail
    By SLanger@spirit21.de in forum PHP Development
    Replies: 0
    Last Post: September 17th, 06:48 AM
  4. #25357 [NEW]: Mail() function is loosing cahracters when sending mail
    By pjsmith at microtech dot co dot gg in forum PHP Development
    Replies: 0
    Last Post: September 2nd, 11:32 AM
  5. [PHP] Mail() Problem Sending
    By Ben C . in forum PHP Development
    Replies: 3
    Last Post: August 19th, 03:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139