The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to import a list of email addresss from a CSV file?

Discussion in 'E-mail Discussions' started by SoftDux, Nov 13, 2007.

  1. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Hi all

    I'd like to know if it's possible to import a list of email addresses & passwords, that I have in a .csv file
     
  2. shaun

    shaun Well-Known Member

    Joined:
    Nov 9, 2001
    Messages:
    698
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    San Clemente, Ca
    /scripts/addpop <email> <pass>

    I think that still works, i have not tested it so give it a try first... if it works it should be very easy for you to take a CSV file and loop it into that script.
     
  3. RandyO

    RandyO Well-Known Member

    Joined:
    Jun 17, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    so how would you do it? "very easy" please post the script if you would

    thanks
     
  4. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    Without seeing your CSV, it would be impossible to tell the format of your file. If it's

    Name, Email, password

    this may work (replace /root/mycsv.csv with the location of your CSV file. You may need to change the cut lines based on the format of your file as well.):

    ##Note: no warranty of any kind is provided with this script. It is provided for informational purposes only. Use the code at your own risk###


    Code:
    #!/bin/sh
    
    while read inputline
    do
            email="$(echo $inputline | cut -d, -f2)"
            pass="$(echo $inputline | cut -d, -f3)"
            /scripts/addpop $email $pass
    done < /root/mycsv.csv
    
    exit 0
     
    #4 DaveUsedToWorkHere, Nov 26, 2007
    Last edited: Nov 26, 2007
Loading...

Share This Page